Skip to content

Commit

Permalink
Fix macos signing
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianEddy committed Sep 3, 2022
1 parent 226e1a1 commit 7fc4ff6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ jobs:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}

- run: make target/gyroflow-ofx-macosx.zip
- run: make target/gyroflow-ofx-macosx.dmg
env:
SIGNING_FINGERPRINT: ${{ secrets.MACOS_CERTIFICATE_FINGERPRINT }}
- name: Notarize and staple release build
run: |
npx notarize-cli --file target/gyroflow-ofx-macosx.zip --bundle-id xyz.gyroflow.ofx --asc-provider="${{ secrets.MACOS_TEAM }}" --username="${{ secrets.MACOS_ACCOUNT_USER }}" --password="${{ secrets.MACOS_ACCOUNT_PASS }}"
xcrun stapler staple --verbose target/gyroflow-ofx-macosx.zip
npx notarize-cli --file target/gyroflow-ofx-macosx.dmg --bundle-id xyz.gyroflow.ofx --asc-provider="${{ secrets.MACOS_TEAM }}" --username="${{ secrets.MACOS_ACCOUNT_USER }}" --password="${{ secrets.MACOS_ACCOUNT_PASS }}"
xcrun stapler staple --verbose target/gyroflow-ofx-macosx.dmg
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/gyroflow-ofx-macosx.zip
files: target/gyroflow-ofx-macosx.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ target/gyroflow-ofx-linux.zip: target/release/libgyroflow_ofx.so LICENSE README.
cp target/bundle-common/Info.plist LICENSE README.md target/gyroflow-ofx-linux/GyroFlow.ofx.bundle/Contents/
cd target/gyroflow-ofx-linux && zip -r ../gyroflow-ofx-linux.zip .

target/gyroflow-ofx-macosx.zip: target/x86_64-apple-darwin/release/libgyroflow_ofx.dylib target/aarch64-apple-darwin/release/libgyroflow_ofx.dylib LICENSE README.md target/bundle-common/Info.plist Makefile
target/gyroflow-ofx-macosx.dmg: target/x86_64-apple-darwin/release/libgyroflow_ofx.dylib target/aarch64-apple-darwin/release/libgyroflow_ofx.dylib LICENSE README.md target/bundle-common/Info.plist Makefile
rm -Rf target/gyroflow-ofx-macosx
rm -f target/gyroflow-ofx-macosx.zip
rm -f target/gyroflow-ofx-macosx.dmg
mkdir -p target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS
lipo target/{x86_64,aarch64}-apple-darwin/release/libgyroflow_ofx.dylib -create -output target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS/GyroFlow.ofx

lipo target/{x86_64,aarch64}-apple-darwin/release/libgyroflow_ofx.dylib -create -output target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS/GyroFlow.dylib
cp target/bundle-common/Info.plist LICENSE README.md target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/

codesign -vvvv --strict --options=runtime --timestamp --force -s ${SIGNING_FINGERPRINT} target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS/GyroFlow.ofx
codesign -vvvv --strict --options=runtime --timestamp --force -s ${SIGNING_FINGERPRINT} target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS/GyroFlow.dylib
mv target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS/GyroFlow.dylib target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle/Contents/MacOS/GyroFlow.ofx

codesign -vvvv --deep --strict --options=runtime --timestamp --force -s ${SIGNING_FINGERPRINT} target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle
codesign -vvvv --deep --verify target/gyroflow-ofx-macosx/GyroFlow.ofx.bundle

cd target/gyroflow-ofx-macosx && zip -r ../gyroflow-ofx-macosx.zip .
ln -sf /Library/OFX/Plugins "target/gyroflow-ofx-macosx/"
hdiutil create "target/gyroflow-ofx-macosx.dmg" -volname "Gyroflow-ofx" -fs HFS+ -srcfolder "target/gyroflow-ofx-macosx/" -ov -format UDZO -imagekey zlib-level=9

codesign -vvvv --strict --options=runtime --timestamp --force -s ${SIGNING_FINGERPRINT} ../gyroflow-ofx-macosx.zip
codesign -vvvv --deep --verify ../gyroflow-ofx-macosx.zip
codesign -vvvv --strict --options=runtime --timestamp --force -s ${SIGNING_FINGERPRINT} target/gyroflow-ofx-macosx.dmg
codesign -vvvv --deep --verify target/gyroflow-ofx-macosx.dmg

target/gyroflow-ofx-windows.zip: target/release/gyroflow_ofx.dll LICENSE README.md target/bundle-common/Info.plist Makefile
rm -Rf target/gyroflow-ofx-windows
Expand Down

0 comments on commit 7fc4ff6

Please sign in to comment.