Skip to content
Merged
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
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,33 @@ jobs:
includeUpdaterJson: true
args: ${{ matrix.args }}

# Tauri notarizes and staples the app inside the .dmg, not the .dmg itself. Notarize and staple the .dmg too
# (retrying, in case the runner's network drops while waiting for Apple), then replace it in the draft release.
- name: Notarize the macOS .dmg
if: matrix.platform == 'macos-latest'
shell: bash
env:
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
target=$(echo "${{ matrix.args }}" | sed -E 's/.*--target ([^ ]+).*/\1/')
dmg=$(find "src-tauri/target/$target/release/bundle/dmg" -maxdepth 1 -name '*.dmg' | head -1)
echo "DMG: $dmg"
for attempt in 1 2 3; do
if xcrun notarytool submit "$dmg" --key "$APPLE_API_KEY_PATH" --key-id "$APPLE_API_KEY" --issuer "$APPLE_API_ISSUER" --wait --timeout 60m --output-format json > notary.json; then
cat notary.json
grep -q '"status" *: *"Accepted"' notary.json && break
echo "::error::Apple did not accept the .dmg"; exit 1
fi
echo "notarytool failed (attempt $attempt); retrying in 30 s"; sleep 30
[ "$attempt" = 3 ] && exit 1
done
xcrun stapler staple "$dmg"
version=$(node -p "require('./package.json').version")
gh release upload "v$version" "$dmg" --clobber --repo "$GITHUB_REPOSITORY"

# Fail the release if a Mac build isn't signed with Developer ID, notarized and stapled.
- name: Check the macOS signature and notarization
if: matrix.platform == 'macos-latest'
Expand All @@ -141,6 +168,7 @@ jobs:
spctl --assess --type execute --verbose=4 "$app"
xcrun stapler validate "$app"
spctl --assess --type open --context context:primary-signature --verbose=4 "$dmg"
xcrun stapler validate "$dmg"

# The VS Code extensions (Veyra Live Server, Veyra Port Manager), attached to the same draft release.
vscode-extension:
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn plain(path: &Path) -> &Path { dunce::simplified(path) }
/// A background command that never opens a console window. Release builds on Windows have no console of their own,
/// so without CREATE_NO_WINDOW every git / gh / health-check call flashes a terminal window on screen.
pub(crate) fn quiet(program: impl AsRef<std::ffi::OsStr>) -> Command {
#[cfg_attr(not(windows), allow(unused_mut))] // changed only on Windows (no console window)
let mut command = Command::new(program);
#[cfg(windows)] { use std::os::windows::process::CommandExt; command.creation_flags(0x0800_0000); }
command
Expand Down
Loading