Skip to content

Commit 441047b

Browse files
committed
Refactor packaging scripts and update release naming conventions
1 parent 2805de9 commit 441047b

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

.github/workflows/package-and-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Package and Release
1+
name: Package and release the zip
22

33
on:
44
push:
@@ -89,7 +89,7 @@ jobs:
8989
uses: actions/upload-artifact@v4
9090
if: "!startsWith(github.ref, 'refs/tags/')"
9191
with:
92-
name: swaggerific-package
92+
name: swaggerific-zip
9393
path: dist/*.zip
9494

9595
- name: Create automatic release (for non-tag pushes)
@@ -99,6 +99,6 @@ jobs:
9999
repo_token: "${{ secrets.GITHUB_TOKEN }}"
100100
automatic_release_tag: "latest"
101101
prerelease: true
102-
title: "Latest Development Build"
102+
title: "Latest Development Zip Package"
103103
files: |
104104
dist/*.zip

package.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cp "$SCRIPT_DIR/target/${APP_NAME}-${VERSION}.jar" "$PACKAGE_DIR/"
4343
echo "Copying JavaFX modules (version $JAVAFX_VERSION)..."
4444

4545
# Determine OS-specific JavaFX modules for each platform
46-
PLATFORMS=("linux" "mac" "win")
46+
PLATFORMS=("linux" "mac" "mac-aarch64" "win")
4747
JAVAFX_MODULES=(
4848
"javafx-base"
4949
"javafx-controls"
@@ -123,13 +123,21 @@ echo "Using JavaFX version: \$JAVAFX_VERSION"
123123
124124
# Determine OS-specific JavaFX modules
125125
OS_NAME=\$(uname -s)
126+
ARCH=\$(uname -m)
127+
126128
case "\$OS_NAME" in
127129
Linux*) JAVAFX_OS="linux" ;;
128-
Darwin*) JAVAFX_OS="mac" ;;
130+
Darwin*)
131+
if [ "\$ARCH" = "arm64" ]; then
132+
JAVAFX_OS="mac-aarch64"
133+
else
134+
JAVAFX_OS="mac"
135+
fi
136+
;;
129137
MINGW*|MSYS*|CYGWIN*) JAVAFX_OS="win" ;;
130138
*) JAVAFX_OS="linux" ;;
131139
esac
132-
echo "Detected OS: \$JAVAFX_OS"
140+
echo "Detected OS: \$JAVAFX_OS (Architecture: \$ARCH)"
133141
134142
# Build module path for JavaFX using local lib directory
135143
JAVAFX_MODULES=(

run.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ if [[ "$JAVA_MAJOR_VERSION" -lt 17 ]]; then
2727
exit 1
2828
fi
2929

30+
VERSION=$(grep -m 1 "<version>" pom.xml | sed -e 's/<version>\(.*\)<\/version>/\1/' -e 's/[[:space:]]//g')
31+
APP_NAME="swaggerific"
32+
PACKAGE_NAME="${APP_NAME}-${VERSION}"
33+
3034
# Check if the JAR file exists
31-
JAR_FILE="$SCRIPT_DIR/target/swaggerific-0.0.3.jar"
35+
JAR_FILE="$SCRIPT_DIR/target/${PACKAGE_NAME}.jar"
3236
if [ ! -f "$JAR_FILE" ]; then
3337
echo "JAR file not found: $JAR_FILE"
3438

@@ -65,13 +69,21 @@ echo "Using JavaFX version: $JAVAFX_VERSION"
6569

6670
# Determine OS-specific JavaFX modules
6771
OS_NAME=$(uname -s)
72+
ARCH=$(uname -m)
73+
6874
case "$OS_NAME" in
6975
Linux*) JAVAFX_OS="linux" ;;
70-
Darwin*) JAVAFX_OS="mac" ;;
76+
Darwin*)
77+
if [ "$ARCH" = "arm64" ]; then
78+
JAVAFX_OS="mac-aarch64"
79+
else
80+
JAVAFX_OS="mac"
81+
fi
82+
;;
7183
MINGW*|MSYS*|CYGWIN*) JAVAFX_OS="win" ;;
7284
*) JAVAFX_OS="linux" ;;
7385
esac
74-
echo "Detected OS: $JAVAFX_OS"
86+
echo "Detected OS: $JAVAFX_OS (Architecture: $ARCH)"
7587

7688
# Find Maven repository location
7789
if [ -d "$HOME/.m2/repository" ]; then

0 commit comments

Comments
 (0)