From 631b99ab01942b441dff4e6a45c020a2afdbf3cb Mon Sep 17 00:00:00 2001 From: Francesco <100066266+cranci1@users.noreply.github.com> Date: Mon, 12 May 2025 19:05:07 +0200 Subject: [PATCH] macOS build workflow too now --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++-- macbuild.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100755 macbuild.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 334ac49..9086c7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ -name: Build and Release IPA +name: Build and Release on: push: branches: - dev jobs: - build: + build-ios: name: Build IPA runs-on: macOS-latest steps: @@ -27,3 +27,31 @@ jobs: name: Sulfur-IPA path: build/Sulfur.ipa compression-level: 0 + + build-mac: + name: Build Mac Catalyst + runs-on: macOS-latest + steps: + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run macbuild.sh + run: | + chmod +x macbuild.sh + ./macbuild.sh + + - name: Create DMG + run: | + hdiutil create -volname "Sulfur" -srcfolder build/Sulfur.app -ov -format UDZO build/Sulfur.dmg + + - name: Upload Mac artifact + uses: actions/upload-artifact@v4 + with: + name: Sulfur-Mac + path: build/Sulfur.dmg + compression-level: 0 diff --git a/macbuild.sh b/macbuild.sh new file mode 100755 index 0000000..c0c5950 --- /dev/null +++ b/macbuild.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e + +cd "$(dirname "$0")" + +WORKING_LOCATION="$(pwd)" +APPLICATION_NAME=Sulfur + +if [ ! -d "build" ]; then + mkdir build +fi + +cd build + +xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \ + -scheme "$APPLICATION_NAME" \ + -configuration Release \ + -derivedDataPath "$WORKING_LOCATION/build/DerivedDataApp" \ + -destination 'platform=macOS,variant=Mac Catalyst' \ + clean build \ + CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" + +DD_APP_PATH="$WORKING_LOCATION/build/DerivedDataApp/Build/Products/Release-maccatalyst/$APPLICATION_NAME.app" +TARGET_APP="$WORKING_LOCATION/build/$APPLICATION_NAME.app" + +cp -r "$DD_APP_PATH" "$TARGET_APP" + +codesign --remove "$TARGET_APP" +if [ -e "$TARGET_APP/_CodeSignature" ]; then + rm -rf "$TARGET_APP/_CodeSignature" +fi + +echo "Mac Catalyst build completed: $TARGET_APP"