Skip to content

Commit

Permalink
Add SHA512SUMS generation
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Nov 19, 2023
1 parent 9e4a973 commit 84e166a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SDK_VERSION: 8.0
GPG_PRIVATE_KEY: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }} # Optional, if secret not provided, will skip signing SHA512SUMS with GPG key. You can specify your own credentials if you'd like to, simply change ARCHIBOT_GPG_PRIVATE_KEY here to the one you want to use
PLUGIN_NAME: MyAwesomePlugin

jobs:
Expand Down Expand Up @@ -140,6 +141,40 @@ jobs:
name: ubuntu-latest_${{ env.PLUGIN_NAME }}
path: out

- name: Import GPG key for signing
uses: crazy-max/ghaction-import-gpg@v6.0.0
if: ${{ env.GPG_PRIVATE_KEY != null }}
with:
gpg_private_key: ${{ env.GPG_PRIVATE_KEY }}

- name: Generate SHA-512 checksums and signature
shell: sh
run: |
set -eu
(
cd "out"
sha512sum *.zip > SHA512SUMS
if [ -n "$GPG_PRIVATE_KEY" ]; then
gpg -a -b -o SHA512SUMS.sign SHA512SUMS
fi
)
- name: Upload SHA512SUMS
uses: actions/upload-artifact@v3.1.3
with:
name: SHA512SUMS
path: out/SHA512SUMS

- name: Upload SHA512SUMS.sign
uses: actions/upload-artifact@v3.1.3
if: ${{ env.GPG_PRIVATE_KEY != null }}
with:
name: SHA512SUMS.sign
path: out/SHA512SUMS.sign

- name: Create GitHub release
uses: ncipollo/release-action@v1.13.0
with:
Expand Down

0 comments on commit 84e166a

Please sign in to comment.