Skip to content

Commit

Permalink
Sign macos app
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarashev committed Jul 12, 2023
1 parent 0886c90 commit dfc620c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:
VERSION: 3.3.3295
WINDOWS_APP_FOLDER_NAME: GanttProject-3.3-Beta-II
MAC_APP_NAME: GanttProject 3.3 Beta II
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}

jobs:
# Linux:
Expand Down Expand Up @@ -151,16 +155,26 @@ jobs:
- name: Build GanttProject.app
run: |
./build-bin/package-mac.sh
cd build
tar -czf ganttproject-app-$VERSION.tgz "GanttProject.app"
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build DMG
- name: Sign GanttProject.app
run: |
pip install "dmgbuild"
dmgbuild -s build-cfg/dmgbuild.py "$MAC_APP_NAME" build/ganttproject-$VERSION.dmg
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
build-bin/notarize.sh $VERSION "BarD Software s.r.o." "qwer" sign
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Build DMG
# run: |
# pip install "dmgbuild"
# dmgbuild -s build-cfg/dmgbuild.py "$MAC_APP_NAME" build/ganttproject-$VERSION.dmg

- id: 'auth'
uses: 'google-github-actions/auth@v1'
Expand All @@ -177,9 +191,6 @@ jobs:
run: |
#!/bin/sh
cd build
for f in *.tgz; do
gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
done;
for f in *.dmg; do
gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
done;
Expand Down
21 changes: 16 additions & 5 deletions build-bin/notarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
VER=$1
SIG=$2
NOTARIZE_PASSWORD=$3

COMMAND=$4

do_prepare() {
find build/GanttProject.app/ -type f -not -path *Contents/runtime/* -not -path */Contents/MacOS/GanttProject -not -path *libapplauncher.dylib -exec codesign --timestamp -f -s "$SIG" --prefix com.bardsoftware. --entitlements build-cfg/ganttproject.entitlements.xml --options runtime -v --keychain ~/Library/Keychains/login.keychain-db {} \;
Expand All @@ -14,7 +14,7 @@ codesign -vvv --deep --strict build/GanttProject.app
spctl -a -t exec -vv build/GanttProject.app


jpackage --type dmg --app-image build/GanttProject.app -n "GanttProject $VER"
jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject-$VER"
}

do_notarize() {
Expand All @@ -26,6 +26,17 @@ do_staple() {
xcrun stapler staple build/GanttProject.app
}

do_prepare
#do_notarize
#do_staple
case $COMMAND in
sign)
do_prepare()
;;
notarize)
do_notarize()
;;
staple)
do_staple()
;;
*)
echo "Unknown command: $COMMAND" && exit 1
;;
esac
2 changes: 1 addition & 1 deletion build-cfg/dmgbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
files = ['build/GanttProject.app', 'ganttproject-builder/HouseBuildingSample.gan', 'LICENSE']
symlinks = { "Applications": "/Applications" }
badge_icon = "build-cfg/ganttproject.icns"
background = "bg3.png"
background = "build-cfg/dmg-background.png"
window_rect = ((100, 100), (512, 512))
icon_size=96
icon_locations = {
Expand Down

0 comments on commit dfc620c

Please sign in to comment.