Merge branch 'main' of https://github.com/syd711/vpin-studio #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build MacOS Client | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
mac-app-build: | |
name: mac-app-build | |
runs-on: macos-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout VPin Studio | |
uses: actions/checkout@v3 | |
- name: Checkout Popper Client Repo | |
uses: actions/checkout@v3 | |
with: | |
repository: syd711/vpin-studio-popper-client | |
path: ./vpin-studio-popper-client | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Checkout Popper Client Repo | |
uses: actions/checkout@v3 | |
with: | |
repository: syd711/vpin-mania-rest-client | |
path: ./vpin-mania-rest-client | |
token: ${{ secrets.ACCESS_TOKEN }} | |
# Step 2: Set up Zulu OpenJDK 17 | |
- name: Set up Zulu JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
# Step 3: Install Maven and dependencies | |
#Zulu 11 does not include jpackage, need to install it | |
# - name: Install Dependencies | |
# run: | | |
# brew update | |
# brew install maven | |
# brew install openjdk@17 # Ensure Zulu JDK 17 is installed on macOS | |
# Step 4: Build the Java application | |
- name: Run maven build for vpin mania rest client | |
working-directory: ./vpin-mania-rest-client | |
run: mvn clean install -DskipTests | |
- name: Run maven build for Assets API | |
working-directory: ./vpin-connector-assets | |
run: mvn clean install -DskipTests | |
- name: Run maven build for popper client | |
working-directory: ./vpin-studio-popper-client | |
run: mvn clean install -DskipTests | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots clean package -DskipMacOSBuild=false -DmacOSBuild=true -DskipTests | |
# Step 5: Package the Java application as a macOS .app bundle | |
#The jpackage config needs to be updated to properly reference the locations of the files. | |
#jpackage @jpackage_config.txt | |
- name: Package as macOS App | |
working-directory: ./mac-package | |
run: | | |
echo "ls . results" | |
ls -al . | |
echo "ls .. results" | |
ls -al .. | |
echo "ls package results" | |
ls -al package | |
echo "ls package/macos results" | |
ls -al package/macos | |
jpackage --name VPin-Studio --input . --app-version 3.11.2 --main-jar ../vpin-studio-ui/target/vpin-studio-ui.jar --main-class de.mephisto.vpin.ui.Launcher --resource-dir package/macos --type app-image --icon VpinStudio.icns --dest ../ --runtime-image $(/usr/libexec/java_home -v 11) | |
# Step 7: Zip the .app bundle for easy distribution | |
#Update for correct location | |
- name: Zip macOS .app Bundle | |
working-directory: ./ | |
run: | | |
zip VPin-Studio-MacOS.zip VPin-Studio.app | |
# Step 8: Upload the .app zip file as an artifact | |
#Update for correct location | |
- name: Upload macOS Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macOS-build | |
path: ./VPin-Studio-MacOS.zip |