Skip to content

Commit

Permalink
🚚 migrate github deprecated macos-12 runners
Browse files Browse the repository at this point in the history
  • Loading branch information
Reverier-Xu committed Nov 10, 2024
1 parent 46a0538 commit 195a598
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 20 additions & 3 deletions deploy_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/

Expand All @@ -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

0 comments on commit 195a598

Please sign in to comment.