Use GitHub Actions to get signature for Sparkle

Requires a secret called `SPARKLE_ED25519_KEY`, in the format of a private key file
This commit is contained in:
Kenneth Chew 2022-05-20 21:57:37 -04:00
parent f3c72f4f08
commit b1f486518e
No known key found for this signature in database
GPG Key ID: F17D3E14A07739DA

View File

@ -100,7 +100,7 @@ jobs:
run: |
brew update
brew install qt@5 ninja
- name: Update Qt (AppImage)
if: runner.os == 'Linux' && matrix.appimage == true
run: |
@ -170,6 +170,27 @@ jobs:
sudo codesign --sign - --deep --force --entitlements "../program_info/App.entitlements" --options runtime "PolyMC.app/Contents/MacOS/polymc"
tar -czf ../PolyMC.tar.gz *
- name: Make Sparkle signature (macOS)
if: runner.os == 'macOS'
run: |
if [ '${{ secrets.SPARKLE_ED25519_KEY }}' != '' ]; then
brew install openssl@3
echo '${{ secrets.SPARKLE_ED25519_KEY }}' > ed25519-priv.pem
signature=$(/usr/local/opt/openssl@3/bin/openssl pkeyutl -sign -rawin -in ${{ github.workspace }}/PolyMC.tar.gz -inkey ed25519-priv.pem | openssl base64 | tr -d \\n)
rm ed25519-priv.pem
cat >> $GITHUB_STEP_SUMMARY << EOF
### Sparkle Signatures :memo:
- macOS Archive: $signature
EOF
else
cat >> $GITHUB_STEP_SUMMARY << EOF
### Sparkle Signatures :memo:
- macOS Archive: No private key available (likely a pull request or fork)
EOF
fi
- name: Package (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}