Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signing to release binaries #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:

- name: 🧐 Test
run: dotnet test --no-build --verbosity normal

- name: 🔏 Sign binaries
if: runner.os == 'Windows'
run: |
osslsigncode sign -certs ${{ secrets.SIGN_CERT_PATH }} -key ${{ secrets.SIGN_CERT_PASS }} -in path/to/binary.exe -out path/to/signed_binary.exe

spa:
name: "SPA App"
Expand Down Expand Up @@ -75,4 +80,4 @@ jobs:
run: npm run build

- name: 🧐 Test
run: npm test
run: npm test
11 changes: 11 additions & 0 deletions scripts/package-electron.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ if ! command -v electronize &> /dev/null; then
exit 1
fi

if ! command -v osslsigncode &> /dev/null; then
echo "Could not find 'osslsigncode'."
exit 1
fi

SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
APP_DIR=$(cd "$SCRIPT_DIR/../src/Apps/NetPad.Apps.App" && pwd)
PACKAGES_SOURCE_DIR="$APP_DIR/bin/Desktop"
Expand Down Expand Up @@ -116,6 +121,12 @@ package() {

echo " - Copying: $filename"
mv "$filename" "$PACKAGES_DEST_DIR/$filename"

if [[ $filename == *.exe* ]]; then
echo " - Signing: $filename"
osslsigncode sign -certs "$SIGN_CERT_PATH" -key "$SIGN_CERT_PASS" -in "$PACKAGES_DEST_DIR/$filename" -out "$PACKAGES_DEST_DIR/$filename.signed"
mv "$PACKAGES_DEST_DIR/$filename.signed" "$PACKAGES_DEST_DIR/$filename"
fi
done
}

Expand Down
7 changes: 6 additions & 1 deletion src/Apps/NetPad.Apps.App/electron.manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ const electronBuilderConfig = {
{
target: "zip"
}
]
],
sign: {
certificateFile: process.env.SIGN_CERT_PATH,
certificatePassword: process.env.SIGN_CERT_PASS,
signToolPath: "osslsigncode"
}
},
pacman: {
artifactName: "${name}-${version}-${os}-${arch}.${ext}",
Expand Down