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 codesign and notarization to Makefile #12

Merged
merged 1 commit into from
Apr 4, 2023
Merged
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: 24 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
all:
all: compile bundle open

release: compile codesign bundle notarize open

open:
open build/alfred-confluence-workflow.alfredworkflow

compile:
# exec "rustup target add aarch64-apple-darwin" before running this
cargo build --release --target=aarch64-apple-darwin
# exec "rustup target add x86_64-apple-darwin" before running this
cargo build --release --target=x86_64-apple-darwin
rm -f build/workflow/alfred-confluence-workflow.alfredworkflow

bundle:
rm -rf build
mkdir -p build
cp target/aarch64-apple-darwin/release/alfred-confluence-workflow workflow/acw-arm
cp target/x86_64-apple-darwin/release/alfred-confluence-workflow workflow/acw-x86
cd workflow && zip -qR alfred-confluence-workflow.alfredworkflow "*"
rm workflow/acw-arm workflow/acw-x86
zip -d workflow/alfred-confluence-workflow.alfredworkflow .DS_Store assets/.DS_Store
mv workflow/alfred-confluence-workflow.alfredworkflow build/
open build/alfred-confluence-workflow.alfredworkflow
rm workflow/acw-arm workflow/acw-x86

codesign:
codesign --force --options runtime --timestamp --sign "${SIGN_CERTIFICATE_NAME}" target/aarch64-apple-darwin/release/alfred-confluence-workflow
codesign --force --options runtime --timestamp --sign "${SIGN_CERTIFICATE_NAME}" target/x86_64-apple-darwin/release/alfred-confluence-workflow

notarize:
zip -qj build/alfred-confluence-workflow.alfredworkflow.zip build/alfred-confluence-workflow.alfredworkflow
xcrun notarytool submit build/alfred-confluence-workflow.alfredworkflow.zip --wait --apple-id "${APPLEID}" --team-id "${TEAMID}"
#xcrun stapler staple build/alfred-confluence-workflow.alfredworkflow.zip
#xcrun notarytool log "${ID}" --apple-id "${APPLEID}" --team-id "${TEAMID}"
rm build/alfred-confluence-workflow.alfredworkflow.zip