Skip to content

Commit

Permalink
Lets try using dmgbuild on Github
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarashev committed Sep 30, 2024
1 parent 48bc946 commit d1b3fe0
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 121 deletions.
235 changes: 117 additions & 118 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
macOS_silicon:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout submodules
shell: bash
run: |
Expand All @@ -147,123 +147,122 @@ jobs:
java-version: 17.0.12
java-package: jdk+fx
cache: 'gradle'
- name: Build GanttProject
run: |
./gradlew distbin
echo "===== PLUGINS ====="
ls ganttproject-builder/dist-bin/plugins/base
- name: Build GanttProject.app
run: |
./build-bin/package-mac.sh
./build/GanttProject.app/Contents/MacOS/GanttProject -h || echo "failed to run"
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'Use gcloud CLI'
run: 'gcloud info'

- name: Sign GanttProject.app
run: |
echo "------------------ PREPARING KEYCHAINS ------------------------"
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
echo "------------------ SIGNING ------------------------"
build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" sign build.keychain
jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
echo "------------------ NOTARIZING ------------------------"
build-bin/notarize.sh $VERSION "BarD Software s.r.o" "$MACOS_NOTARIZE_PASSWORD" notarize
build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" staple
rm build/*.dmg
jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
cd build
mv ganttproject-1.0.dmg ganttproject-$VERSION-silicon.dmg
- name: Upload artifacts
run: |
#!/bin/sh
cd build
for f in *.dmg; do
gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
done;
macOS_intel:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
shell: bash
run: |
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1
echo "$VERSION" > ganttproject-builder/VERSION
- uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: 17.0.12
java-package: jdk+fx
cache: 'gradle'
- name: Build GanttProject
run: |
./gradlew distbin
echo "===== PLUGINS ====="
ls ganttproject-builder/dist-bin/plugins/base
- name: Build GanttProject.app
run: |
./build-bin/package-mac.sh
./build/GanttProject.app/Contents/MacOS/GanttProject -h || echo "failed to run"
- name: Sign GanttProject.app
run: |
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
echo "------------------ NOW SIGNING ------------------------"
build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" sign build.keychain
jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
build-bin/notarize.sh $VERSION "BarD Software s.r.o" "$MACOS_NOTARIZE_PASSWORD" notarize
build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" staple
rm build/*.dmg
jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
cd build
mv ganttproject-1.0.dmg ganttproject-$VERSION-intel.dmg
# - name: Build GanttProject
# run: |
# ./gradlew distbin
# echo "===== PLUGINS ====="
# ls ganttproject-builder/dist-bin/plugins/base

- id: 'auth'
uses: 'google-github-actions/auth@v1'
# - name: Build GanttProject.app
# run: |
# ./build-bin/package-mac.sh
# ./build/GanttProject.app/Contents/MacOS/GanttProject -h || echo "failed to run"
#
# - id: 'auth'
# uses: 'google-github-actions/auth@v1'
# with:
# credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
#
# - name: 'Set up Cloud SDK'
# uses: 'google-github-actions/setup-gcloud@v1'
#
# - name: 'Use gcloud CLI'
# run: 'gcloud info'
#
# - name: Sign GanttProject.app
# run: |
# echo "------------------ PREPARING KEYCHAINS ------------------------"
# 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
#
# echo "------------------ SIGNING ------------------------"
# build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" sign build.keychain
# jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
#
# echo "------------------ NOTARIZING ------------------------"
# build-bin/notarize.sh $VERSION "BarD Software s.r.o" "$MACOS_NOTARIZE_PASSWORD" notarize
# build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" staple
# rm build/*.dmg
#
- uses: actions/setup-python@v5
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
python-version: '3.10'
- run: |
curl https://storage.googleapis.com/dl.ganttproject.biz/GanttProject.zip > build/GanttProject.zip
cd build && unzip GanttProject.zip & cd ..
pip install dmgbuild
dmgbuild -s dmgbuild.py "$MAC_APP_NAME" ./ganttproject-$VERSION-silicon.dmg
gsutil cp ./ganttproject-$VERSION-silicon.dmg gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/ganttproject-$VERSION-silicon.dmg;
- name: 'Use gcloud CLI'
run: 'gcloud info'

- name: Upload artifacts
run: |
#!/bin/sh
cd build
for f in *.dmg; do
gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
done;
# macOS_intel:
# runs-on: macos-13
# steps:
# - uses: actions/checkout@v3
# - name: Checkout submodules
# shell: bash
# run: |
# git submodule sync --recursive
# git submodule update --init --force --recursive --depth=1
# echo "$VERSION" > ganttproject-builder/VERSION
# - uses: actions/setup-java@v3
# with:
# distribution: 'liberica'
# java-version: 17.0.12
# java-package: jdk+fx
# cache: 'gradle'
# - name: Build GanttProject
# run: |
# ./gradlew distbin
# echo "===== PLUGINS ====="
# ls ganttproject-builder/dist-bin/plugins/base
#
# - name: Build GanttProject.app
# run: |
# ./build-bin/package-mac.sh
# ./build/GanttProject.app/Contents/MacOS/GanttProject -h || echo "failed to run"
#
# - name: Sign GanttProject.app
# run: |
# 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
#
# echo "------------------ NOW SIGNING ------------------------"
#
# build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" sign build.keychain
#
# jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
# build-bin/notarize.sh $VERSION "BarD Software s.r.o" "$MACOS_NOTARIZE_PASSWORD" notarize
# build-bin/notarize.sh $VERSION "BarD Software s.r.o" "--" staple
# rm build/*.dmg
# jpackage --type dmg --app-image build/GanttProject.app -n "ganttproject" --dest build/
# cd build
# mv ganttproject-1.0.dmg ganttproject-$VERSION-intel.dmg
#
# - id: 'auth'
# uses: 'google-github-actions/auth@v1'
# with:
# credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
#
# - name: 'Set up Cloud SDK'
# uses: 'google-github-actions/setup-gcloud@v1'
#
# - name: 'Use gcloud CLI'
# run: 'gcloud info'
#
# - name: Upload artifacts
# run: |
# #!/bin/sh
# cd build
# for f in *.dmg; do
# gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
# done;
Binary file added build-cfg/bg4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions build-cfg/dmgbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
files = ['build/GanttProject.app', 'ganttproject-builder/HouseBuildingSample.gan', 'LICENSE']
symlinks = { "Applications": "/Applications" }
badge_icon = "build-cfg/ganttproject.icns"
background = "build-cfg/dmg-background.png"
window_rect = ((100, 100), (512, 512))
background = "build-cfg/bg4.png"
window_rect = ((100, 100), (800, 800))
icon_size=96
text_size=14
icon_locations = {
"GanttProject.app": (0, 200), "Applications": (275, 200), "HouseBuildingSample.gan": (256, 0), "LICENSE": (100, 0)
"GanttProject.app": (150, 420), "Applications": (660, 420), "HouseBuildingSample.gan": (150, 670), "LICENSE": (300, 670)
}

0 comments on commit d1b3fe0

Please sign in to comment.