Skip to content

Commit

Permalink
Fix publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed Jul 17, 2024
1 parent edf1e8a commit e59bf92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- 'entries/**'
- 'img/**'
- 'scripts/*'

concurrency:
group: 'publish'
Expand All @@ -22,6 +23,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '2'

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down
16 changes: 10 additions & 6 deletions scripts/Sign.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash

# Load environment variables
source .env
# Create a temporary file to track the status
STATUS_FILE=$(mktemp)
echo 0 > "$STATUS_FILE"

sign_and_verify() {
local f="$1"
echo "$f.sig"
echo "$PGP_PASSWORD" | gpg --yes --passphrase --local-user "$PGP_KEY_ID" --output "$f.sig" --sign "$f" 2>/dev/null
gpg --verify "$f.sig" 2>/dev/null
if [ $? -ne 0 ]; then
echo "::error f=$f:: File signing failed"
exit 1
if ! gpg --verify "$f.sig" 2>/dev/null; then
echo "::error f=$f:: File signing failed for $f"
echo 1 > "$STATUS_FILE"
fi
}

Expand All @@ -21,3 +21,7 @@ done

# Wait for all background processes to complete
wait

STATUS=$(cat "$STATUS_FILE")
rm "$STATUS_FILE"
exit "$STATUS"

0 comments on commit e59bf92

Please sign in to comment.