Skip to content

Commit

Permalink
Experiment with building dmg on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarashev committed Jul 12, 2023
1 parent 4ebb2cc commit 5b8b886
Showing 1 changed file with 123 additions and 114 deletions.
237 changes: 123 additions & 114 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,120 +11,120 @@ env:
MAC_APP_NAME: GanttProject 3.3 Beta II

jobs:
Linux:
runs-on: ubuntu-latest
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.7
java-package: jdk+fx
cache: 'gradle'
- name: Build GanttProject
run: |
./gradlew distbin distzip
./gradlew -PwithJavafx distdeb
echo "===== PLUGINS ====="
ls ganttproject-builder/dist-bin/plugins/base
echo "===== DISTRIBUTIONS ====="
ls build/distributions
- 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 Packages
run: |
#!/bin/sh
cd build/distributions
for f in *; do
gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
done;
Windows:
runs-on: windows-latest
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.7
java-package: jdk+fx
cache: 'gradle'
- name: Build GanttProject
run: |
./gradlew distbin
echo "===== PLUGINS ====="
ls ganttproject-builder/dist-bin/plugins/base
- name: Build MSI installer
run: |
build-bin/package-win.bat
- 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 Packages
run: |
gsutil cp build\ganttproject-$env:VERSION.msi gs://dl.ganttproject.biz
gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/ganttproject-$env:VERSION.msi
- name: Install NSIS
run: |
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop update
scoop bucket add extras
scoop install nsis
- name: Print NSIS version
run: makensis -VERSION
- name: Print NSIS compile flags
run: makensis -HDRINFO

- name: Prepare files for NSIS
run: |
./gradlew distwin
echo "===== dist-win ====="
ls ganttproject-builder/dist-win
- name: Build NSIS package
run: |
cd ganttproject-builder\dist-win
makensis ganttproject.nsi
dir
mv ganttproject-$env:VERSION.exe ..\..\build
- name: Upload Packages
run: |
gsutil cp build\ganttproject-$env:VERSION.exe gs://dl.ganttproject.biz
gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/ganttproject-$env:VERSION.exe
# Linux:
# runs-on: ubuntu-latest
# 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.7
# java-package: jdk+fx
# cache: 'gradle'
# - name: Build GanttProject
# run: |
# ./gradlew distbin distzip
# ./gradlew -PwithJavafx distdeb
# echo "===== PLUGINS ====="
# ls ganttproject-builder/dist-bin/plugins/base
# echo "===== DISTRIBUTIONS ====="
# ls build/distributions
#
# - 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 Packages
# run: |
# #!/bin/sh
# cd build/distributions
# for f in *; do
# gsutil cp $f gs://dl.ganttproject.biz && gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/$f;
# done;
#
# Windows:
# runs-on: windows-latest
# 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.7
# java-package: jdk+fx
# cache: 'gradle'
# - name: Build GanttProject
# run: |
# ./gradlew distbin
# echo "===== PLUGINS ====="
# ls ganttproject-builder/dist-bin/plugins/base
# - name: Build MSI installer
# run: |
# build-bin/package-win.bat
#
# - 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 Packages
# run: |
# gsutil cp build\ganttproject-$env:VERSION.msi gs://dl.ganttproject.biz
# gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/ganttproject-$env:VERSION.msi
#
# - name: Install NSIS
# run: |
# iwr -useb get.scoop.sh -outfile 'install.ps1'
# .\install.ps1 -RunAsAdmin
# scoop update
# scoop bucket add extras
# scoop install nsis
# - name: Print NSIS version
# run: makensis -VERSION
# - name: Print NSIS compile flags
# run: makensis -HDRINFO
#
# - name: Prepare files for NSIS
# run: |
# ./gradlew distwin
# echo "===== dist-win ====="
# ls ganttproject-builder/dist-win
#
# - name: Build NSIS package
# run: |
# cd ganttproject-builder\dist-win
# makensis ganttproject.nsi
# dir
# mv ganttproject-$env:VERSION.exe ..\..\build
#
# - name: Upload Packages
# run: |
# gsutil cp build\ganttproject-$env:VERSION.exe gs://dl.ganttproject.biz
# gsutil acl ch -u AllUsers:R gs://dl.ganttproject.biz/ganttproject-$env:VERSION.exe

macOS:
runs-on: macos-latest
Expand Down Expand Up @@ -154,6 +154,12 @@ jobs:
cd build
tar -czf ganttproject-app-$VERSION.tgz "${MAC_APP_NAME}.app"
- uses: actions/setup-python@v4
- name: Build DMG
run: |
pip install "dmgbuild"
dmgbuild -s build-cfg/dmgbuild.py "GanttProject Test" build/ganttproject-$VERSION.dmg
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
Expand All @@ -172,6 +178,9 @@ jobs:
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;
# packageLinux:
# runs-on: ubuntu-latest
Expand Down

0 comments on commit 5b8b886

Please sign in to comment.