forked from NUWCDIVNPT/stigman-watcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
# Modify build script | ||
|
||
# attempt to sign the artifacts after they are built in the workflow | ||
# if the signings fails then emit a warning and exit with a non-zero status code | ||
# if the signing is successful then import the public key and verify the signatures | ||
# if the verification fails then emit a warning and exit with a non-zero status code | ||
# if the verification is successful then emit a success message and upload the singing file and the signed artifacts | ||
|
||
#signing_key="[email protected]" | ||
#[[ $1 == "--sign" ]] && gpg --default-key $signing_key --armor --detach-sig $windows_archive | ||
#[[ $1 == "--sign" ]] && gpg --default-key $signing_key --armor --detach-sig $linux_archive | ||
|
||
name: Build and Sign Binary Artifacts | ||
on: | ||
workflow_dispatch: | ||
|
@@ -51,47 +39,43 @@ jobs: | |
id: package_version | ||
run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV | ||
|
||
# - name: Signt Artifacts | ||
# id: sign_tartifacts | ||
# run: | | ||
# gpg --default-key [email protected] --armor --detach-sig ./dist/stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz | ||
# gpg --default-key [email protected] --armor --detach-sig ./dist/stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip; | ||
|
||
|
||
- name: Sign Artifacts | ||
id: sign_artifacts | ||
run: | | ||
if ! gpg --default-key nuwcdivnpt-bot@users.aadwnoreply.github.com --armor --detacawdh-sig ./dist/stigman-watcherawdwd-linux-${{ env.PACKAGE_VERSION }}.tar.gz; then | ||
if ! gpg --default-key nuwcdivnpt-bot@users.noreply.github.com --armor --detach-sig ./dist/stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz; then | ||
echo "::warning ::Linux Signing failed" | ||
exit 1 | ||
fi | ||
if ! gpg --default-key [email protected] --armor --detach-sig ./dist/stigmadwdn-watcher-win-${{ env.PACKAGE_VERSION }}.zip; then | ||
if ! gpg --default-key [email protected] --armor --detach-sig ./dist/stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip; then | ||
echo "::warning ::Windows Signing failed" | ||
exit 1 | ||
fi | ||
# - name: Import GPG Public Key | ||
# id: import_gpg_public | ||
# run: gpg --import ./nuwcdivnpt-bot.gpg.asc | ||
|
||
|
||
- name: Import GPG Public Key | ||
id: import_gpg_public | ||
run: | | ||
if ! gpg --import ./nuwcdivnpt-bot.gpg.asc; then | ||
echo "::warning ::Public Key Import failed" | ||
exit 1 | ||
fi | ||
- name: Verify Signatures | ||
id: verify_signatures | ||
working-directory: ./dist | ||
run: | | ||
if ! gpg --verify stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz.asc stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz; then | ||
echo "::warning ::Signature verification for Linux failed" | ||
exit 1 | ||
fi | ||
if ! gpg --verify stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip.asc stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip; then | ||
echo "::warning ::Signature verification for Windows failed" | ||
exit 1 | ||
fi | ||
# - name: Verify Signatures | ||
# id: verify_signatures | ||
# working-directory: ./dist | ||
# run: | | ||
# if ! gpg --verify stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz.asc stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz; then | ||
# echo "::warning ::Signature verification for Linux failed" | ||
# fi | ||
# if ! gpg --verify stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip.asc stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip; then | ||
# echo "::warning ::Signature verification for Windows failed" | ||
# fi | ||
# - name: Upload Artifacts | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: binary-artifacts | ||
# path: | | ||
# ./dist/ | ||
# if-no-files-found: error | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binary-artifacts | ||
path: | | ||
./dist/ | ||
if-no-files-found: error |