Skip to content

Commit

Permalink
Merge pull request #22 from glaumar/ci/macOsConfigRosseta
Browse files Browse the repository at this point in the history
init ci macos config for rosseta
  • Loading branch information
victorwads authored Aug 14, 2024
2 parents bd4526d + f7b0684 commit ae694bf
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/macos_bundle_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.TOKEN }}
file: macOs/QRookie_arm64.dmg
asset_name: QRookie_macOs_arm64.dmg
file: macOs/QRookie_${{ github.ref }}_arm64.dmg
asset_name: QRookie_${{ github.ref }}_arm64.dmg
tag: ${{ github.ref }}
10 changes: 5 additions & 5 deletions .github/workflows/macos_bundle_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
runs-on: macos-13
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -15,17 +15,17 @@ 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/
./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
file: macOs/QRookie_${{ github.ref }}_x86_64.dmg
asset_name: QRookie_${{ github.ref }}_x86_64.dmg
tag: ${{ github.ref }}
2 changes: 1 addition & 1 deletion macOs/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
<key>CFBundleIconFile</key>
<string>icon</string>
<key>LSMinimumSystemVersion</key>
<string>12</string>
<string>13</string>
</dict>
</plist>
4 changes: 3 additions & 1 deletion macOs/projectConfig.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
export ARCH=$(arch)
export OS_TARGET="12"
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)"
Expand Down
9 changes: 6 additions & 3 deletions macOs/signApp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

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

0 comments on commit ae694bf

Please sign in to comment.