From 9fd08b23d21fefe6ea7fdc176f1a9d921bf0c4ef Mon Sep 17 00:00:00 2001 From: Victor Wads Date: Wed, 14 Aug 2024 15:07:56 -0300 Subject: [PATCH 1/3] init ci macos config for rosseta --- .github/workflows/macos_bundle_arm64.yml | 2 +- .github/workflows/macos_bundle_x86_64.yml | 7 ++++--- macOs/Info.plist | 2 +- macOs/projectConfig.sh | 2 +- macOs/signApp.sh | 5 ++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos_bundle_arm64.yml b/.github/workflows/macos_bundle_arm64.yml index 8cc8f15..721ec4b 100644 --- a/.github/workflows/macos_bundle_arm64.yml +++ b/.github/workflows/macos_bundle_arm64.yml @@ -27,5 +27,5 @@ jobs: with: repo_token: ${{ secrets.TOKEN }} file: macOs/QRookie_arm64.dmg - asset_name: QRookie_macOs_arm64.dmg + asset_name: QRookie_${{ github.ref }}_macOs_arm64.dmg tag: ${{ github.ref }} \ No newline at end of file diff --git a/.github/workflows/macos_bundle_x86_64.yml b/.github/workflows/macos_bundle_x86_64.yml index 294c402..a10c779 100644 --- a/.github/workflows/macos_bundle_x86_64.yml +++ b/.github/workflows/macos_bundle_x86_64.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -19,13 +19,14 @@ jobs: - name: Build run: | + cd macOs/ - ./signApp.sh + arch -x86_64 ./signApp.sh - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.TOKEN }} file: macOs/QRookie_x86_64.dmg - asset_name: QRookie_macOs_x86_64.dmg + asset_name: QRookie_${{ github.ref }}_macOs_x86_64.dmg tag: ${{ github.ref }} \ No newline at end of file diff --git a/macOs/Info.plist b/macOs/Info.plist index 532c9e0..ab0cef7 100644 --- a/macOs/Info.plist +++ b/macOs/Info.plist @@ -15,6 +15,6 @@ CFBundleIconFile icon LSMinimumSystemVersion - 12 + 13 \ No newline at end of file diff --git a/macOs/projectConfig.sh b/macOs/projectConfig.sh index 44a3623..97463e6 100644 --- a/macOs/projectConfig.sh +++ b/macOs/projectConfig.sh @@ -1,6 +1,6 @@ #!/bin/bash export ARCH=$(arch) -export OS_TARGET="12" +export OS_TARGET="13" if [[ "$ARCH" == "arm64" ]]; then export ARCH_NAME="arm64" eval "$(/opt/homebrew/bin/brew shellenv)" diff --git a/macOs/signApp.sh b/macOs/signApp.sh index 42facc3..1f7b9c2 100755 --- a/macOs/signApp.sh +++ b/macOs/signApp.sh @@ -38,8 +38,11 @@ xcrun notarytool submit "$DMG_NAME" \ --keychain-profile "$ACCOUNT_PROFILE" \ --wait +xcrun stapler staple "$DMG_NAME" + printf "\e[1;32mVerifying the app bundle...\e[0m\n" -spctl --assess --type exec -vv "${DMG_NAME}" +# spctl --assess --type exec -vv "${DMG_NAME}" +codesign --verify --deep --strict --verbose=2 "$APP_PATH" codesign --verify --deep --strict --verbose=2 "${DMG_NAME}" # Always returning true ensures that the github action will not terminate due to errors in this script. From 5dbdeb90e3305f95f64a56bb7fd4df984259b58d Mon Sep 17 00:00:00 2001 From: Victor Wads Date: Wed, 14 Aug 2024 16:14:20 -0300 Subject: [PATCH 2/3] fix ci x86_64 brew install --- .github/workflows/macos_bundle_x86_64.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos_bundle_x86_64.yml b/.github/workflows/macos_bundle_x86_64.yml index a10c779..f3da283 100644 --- a/.github/workflows/macos_bundle_x86_64.yml +++ b/.github/workflows/macos_bundle_x86_64.yml @@ -15,11 +15,10 @@ jobs: - name: Install Homebrew run: | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - name: Build run: | - cd macOs/ arch -x86_64 ./signApp.sh From f7b06847fd23f7c338bafeebb7973377163b5d0b Mon Sep 17 00:00:00 2001 From: Victor Wads Date: Wed, 14 Aug 2024 16:14:36 -0300 Subject: [PATCH 3/3] config macOs bundles names --- .github/workflows/macos_bundle_arm64.yml | 4 ++-- .github/workflows/macos_bundle_x86_64.yml | 4 ++-- macOs/projectConfig.sh | 2 ++ macOs/signApp.sh | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos_bundle_arm64.yml b/.github/workflows/macos_bundle_arm64.yml index 721ec4b..ef18a3c 100644 --- a/.github/workflows/macos_bundle_arm64.yml +++ b/.github/workflows/macos_bundle_arm64.yml @@ -26,6 +26,6 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.TOKEN }} - file: macOs/QRookie_arm64.dmg - asset_name: QRookie_${{ github.ref }}_macOs_arm64.dmg + file: macOs/QRookie_${{ github.ref }}_arm64.dmg + asset_name: QRookie_${{ github.ref }}_arm64.dmg tag: ${{ github.ref }} \ No newline at end of file diff --git a/.github/workflows/macos_bundle_x86_64.yml b/.github/workflows/macos_bundle_x86_64.yml index f3da283..d334e1d 100644 --- a/.github/workflows/macos_bundle_x86_64.yml +++ b/.github/workflows/macos_bundle_x86_64.yml @@ -26,6 +26,6 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.TOKEN }} - file: macOs/QRookie_x86_64.dmg - asset_name: QRookie_${{ github.ref }}_macOs_x86_64.dmg + file: macOs/QRookie_${{ github.ref }}_x86_64.dmg + asset_name: QRookie_${{ github.ref }}_x86_64.dmg tag: ${{ github.ref }} \ No newline at end of file diff --git a/macOs/projectConfig.sh b/macOs/projectConfig.sh index 97463e6..ec5886f 100644 --- a/macOs/projectConfig.sh +++ b/macOs/projectConfig.sh @@ -1,6 +1,8 @@ #!/bin/bash export ARCH=$(arch) export OS_TARGET="13" +export APP_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" Info.plist) + if [[ "$ARCH" == "arm64" ]]; then export ARCH_NAME="arm64" eval "$(/opt/homebrew/bin/brew shellenv)" diff --git a/macOs/signApp.sh b/macOs/signApp.sh index 1f7b9c2..b3e3918 100755 --- a/macOs/signApp.sh +++ b/macOs/signApp.sh @@ -16,7 +16,7 @@ cd "${BUILD_DIR}" printf "\e[1;32mAssign all the libraries inside the app bundle\e[0m\n" find "$APP_PATH" -type f -name "*.dylib" -exec \ -codesign --deep --force --verify --verbose --timestamp --options runtime --sign "$DEVELOPER_ID" {} \; + codesign --deep --force --verify --verbose --timestamp --options runtime --sign "$DEVELOPER_ID" {} \; printf "\e[1;32mAssign .app\e[0m\n" codesign --deep --force --verify --verbose --timestamp --options runtime --sign "$DEVELOPER_ID" "$APP_PATH" @@ -26,7 +26,7 @@ rm -rf "$DMG_DIR" mkdir -p "$DMG_DIR" cp -r "$APP_PATH" "$DMG_DIR/" -DMG_NAME="$WORKING_DIR/${APP_NAME}_${ARCH_NAME}.dmg" +DMG_NAME="$WORKING_DIR/${APP_NAME}_${APP_VERSION}_${ARCH_NAME}.dmg" hdiutil create -volname "$APP_NAME" -srcfolder "$DMG_DIR" -ov -format UDBZ "$DMG_NAME" rm -rf "$DMG_DIR"