diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 785d91b..952c74b 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -108,7 +108,7 @@ jobs: # Deploy application - name: Deploy application - run: ./deploy_macos.sh -c -p + run: ./deploy_macos.sh -c -p --x86_64 # Upload application DMG - name: Upload application DMG uses: actions/upload-artifact@v4 @@ -152,7 +152,7 @@ jobs: # Deploy application - name: Deploy application - run: ./deploy_macos.sh -c -p + run: ./deploy_macos.sh -c -p --arm64 # Upload application DMG - name: Upload application DMG uses: actions/upload-artifact@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cdaeed9..e7b2891 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -109,7 +109,7 @@ jobs: # Deploy application - name: Deploy application - run: ./deploy_macos.sh -c -p + run: ./deploy_macos.sh -c -p --x86_64 # Upload application DMG - name: Upload application DMG @@ -161,7 +161,7 @@ jobs: # Deploy application - name: Deploy application - run: ./deploy_macos.sh -c -p + run: ./deploy_macos.sh -c -p --arm64 # Upload application DMG - name: Upload application DMG diff --git a/deploy_macos.sh b/deploy_macos.sh index ecf91e1..4aba8a4 100755 --- a/deploy_macos.sh +++ b/deploy_macos.sh @@ -4,7 +4,25 @@ export APP_NAME="WebSocketReflectorX" export APP_VERSION=0.2.31 export GIT_VERSION=$(git rev-parse --short HEAD) -echo "> $APP_NAME packager (macOS x86_64) [v$APP_VERSION]" +arch=x86_64 + +while [[ $# -gt 0 ]] +do +case $1 in + --x86_64) + arch=x86_64 + ;; + --arm64) + arch=arm64 + ;; + *) + echo "> Unknown argument '$1'" + ;; +esac +shift # skip argument or value +done + +echo "> $APP_NAME packager (macOS $arch) [v$APP_VERSION]" if [ "$(id -u)" == "0" ]; then echo "This script MUST NOT be run as root" 1>&2 @@ -15,7 +33,6 @@ if [ ${PWD##*/} != $APP_NAME ]; then echo "This script MUST be run from the $APP_NAME/ directory" exit 1 fi -CPU_ARCH=$(uname -m) export LD_LIBRARY_PATH=$(pwd)/contribs/src/env/macOS_x86_64/usr/lib/ @@ -28,4 +45,4 @@ find $APP_NAME.app/ -name "*.dSYM" | xargs rm -rf sleep 3 hdiutil create $APP_NAME-tmp.dmg -ov -volname $APP_NAME -fs HFS+ -srcfolder ./$APP_NAME.app hdiutil convert $APP_NAME-tmp.dmg -format UDZO -o $APP_NAME.dmg -mv $APP_NAME.dmg $APP_NAME-$APP_VERSION-macOS-$CPU_ARCH.dmg +mv $APP_NAME.dmg $APP_NAME-$APP_VERSION-macOS-$arch.dmg