Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
apk_release_path: ${{ steps.release_artifact.outputs.apk_release_path }}
apk_fdroid_path: ${{ steps.fdroid_artifact.outputs.apk_fdroid_path }}
checksums_path: ${{ steps.checksums.outputs.checksums_path }}
signature_path: ${{ steps.signature.outputs.signature_path }}

steps:
- name: Checkout source
Expand Down Expand Up @@ -171,9 +172,34 @@ jobs:
id: checksums
shell: bash
run: |
find . -name '*.apk' -type f -exec sha256sum {} \; > checksums.txt
set -euo pipefail
find . -name '*.apk' -type f -exec bash -c 'sha256sum "$1" | awk -v bn="$(basename $1)" "{print \$1, bn}"' _ {} \; > checksums.txt
echo "checksums_path=checksums.txt" >> "$GITHUB_OUTPUT"

- name: Import PGP key
shell: bash
run: |
set -euo pipefail
echo "$PGP_PRIVATE_KEY" | gpg --import --batch --yes
env:
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}

- name: Sign checksums file
id: signature
shell: bash
run: |
set -euo pipefail
gpg --detach-sign --armor --batch --yes --passphrase "$PGP_PASSPHRASE" --output checksums.txt.sig checksums.txt
echo "signature_path=checksums.txt.sig" >> "$GITHUB_OUTPUT"
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}

- name: Verify checksums signature
shell: bash
run: |
set -euo pipefail
gpg --verify checksums.txt.sig checksums.txt

- name: Upload all build outputs
uses: actions/upload-artifact@v4
with:
Expand All @@ -182,6 +208,7 @@ jobs:
${{ steps.release_artifact.outputs.apk_release_path }}
${{ steps.fdroid_artifact.outputs.apk_fdroid_path }}
${{ steps.checksums.outputs.checksums_path }}
${{ steps.signature.outputs.signature_path }}

generate_release_notes:
needs: build
Expand Down Expand Up @@ -231,6 +258,7 @@ jobs:
files: |
downloaded/**/*.apk
downloaded/*.txt
downloaded/*.sig
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -262,7 +290,12 @@ jobs:
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com

- name: Cleanup signing key
- name: Cleanup signing keys
if: always()
run: rm -f presentation/my-release-key.keystore

shell: bash
run: |
set -euo pipefail
rm -f presentation/my-release-key.keystore
gpg --batch --yes --delete-secret-keys "$PGP_FINGERPRINT"
env:
PGP_FINGERPRINT: ${{ secrets.PGP_FINGERPRINT }}