|
| 1 | +name: Build and Notarize Support App - Alpha Manual - Xcode Beta |
| 2 | + |
| 3 | +on: [workflow_dispatch] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_with_signing: |
| 7 | + runs-on: macos-15 |
| 8 | + environment: production |
| 9 | + |
| 10 | + steps: |
| 11 | + - name: Checkout repository |
| 12 | + uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - name: Bump Build Number and set version number to env |
| 15 | + run: | |
| 16 | + cd ./src |
| 17 | + xcrun agvtool next-version -all |
| 18 | + |
| 19 | + APP_BUILD_NUMBER=$(xcrun agvtool vers -terse) |
| 20 | + echo "Build number: ${APP_BUILD_NUMBER}" |
| 21 | + echo "APP_BUILD_NUMBER=${APP_BUILD_NUMBER}" >> $GITHUB_ENV |
| 22 | + |
| 23 | + APP_VERSION=$(/usr/libexec/PlistBuddy -c Print:CFBundleShortVersionString Support/Info.plist) |
| 24 | + echo "Version number: ${APP_VERSION}" |
| 25 | + echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV |
| 26 | +
|
| 27 | + - name: Commit Changes |
| 28 | + env: |
| 29 | + APP_BUILD_NUMBER: ${{ env.APP_BUILD_NUMBER }} |
| 30 | + run: | |
| 31 | + git add . |
| 32 | + git config --local user.email "action@github.com" |
| 33 | + git config --local user.name "GitHub Action" |
| 34 | + git commit -m "Bump build number to ${APP_BUILD_NUMBER}" |
| 35 | +
|
| 36 | + - name: Push Changes |
| 37 | + uses: ad-m/github-push-action@v0.8.0 |
| 38 | + with: |
| 39 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + branch: ${{ github.ref }} |
| 41 | + |
| 42 | + - name: Install Developer ID Application certificate |
| 43 | + uses: apple-actions/import-codesign-certs@v2 |
| 44 | + with: |
| 45 | + keychain-password: ${{ github.run_id }} |
| 46 | + p12-file-base64: ${{ secrets.DEVELOPER_ID_APPLICATION_BASE64 }} |
| 47 | + p12-password: ${{ secrets.DEVELOPER_ID_APPLICATION_PASSWORD }} |
| 48 | + |
| 49 | + - name: Install Developer ID Installer certificate |
| 50 | + uses: apple-actions/import-codesign-certs@v2 |
| 51 | + with: |
| 52 | + create-keychain: false |
| 53 | + keychain-password: ${{ github.run_id }} |
| 54 | + p12-file-base64: ${{ secrets.DEVELOPER_ID_INSTALLER_BASE64 }} |
| 55 | + p12-password: ${{ secrets.DEVELOPER_ID_INSTALLER_PASSWORD }} |
| 56 | + |
| 57 | + - name: Enable beta watermark |
| 58 | + run: | |
| 59 | + sed -i '' "s/let betaRelease: Bool = false/let betaRelease: Bool = true/g" ./src/Support/Preferences.swift |
| 60 | +
|
| 61 | + - name: Build macOS app |
| 62 | + run: | |
| 63 | + ARCHIVE_PATH="./build/Support.xcarchive" |
| 64 | + APP_PATH="./build" |
| 65 | +
|
| 66 | + ls -la /Applications |
| 67 | +
|
| 68 | + # Set Xcode version to latest version available |
| 69 | + # XCODE_VERSION=$(ls -d /Applications/Xcode*.app 2>/dev/null | sort -V | tail -n 1) |
| 70 | + # echo "Path to latest Xcode version: ${XCODE_VERSION}" |
| 71 | + XCODE_VERSION="${{vars.XCODE_VERSION_BETA}}" |
| 72 | +
|
| 73 | + # Select Xcode version |
| 74 | + sudo xcode-select -s "${XCODE_VERSION}" |
| 75 | +
|
| 76 | + # Build and archive app |
| 77 | + "${XCODE_VERSION}/Contents/Developer/usr/bin/xcodebuild" clean build -project ./src/Support.xcodeproj -scheme "Support" -configuration Release CODE_SIGN_IDENTITY="Developer ID Application: Root3 B.V. (98LJ4XBGYK)" -archivePath $ARCHIVE_PATH archive |
| 78 | + "${XCODE_VERSION}/Contents/Developer/usr/bin/xcodebuild" -archivePath $ARCHIVE_PATH -exportArchive -exportPath $APP_PATH -exportOptionsPlist ./pkgbuild/exportOptions.plist |
| 79 | + chmod +x "${APP_PATH}/Support.app" |
| 80 | +
|
| 81 | + - name: Notarize and package macOS app |
| 82 | + run: |
| 83 | + ./build_pkg_automated.zsh "${{env.APP_VERSION}}" "${{ secrets.APPLE_ID }}" "${{ secrets.APPLE_ID_APP_SPECIFIC_PASSWORD }}" "${{vars.XCODE_VERSION_BETA}}" |
| 84 | + |
| 85 | + - name: Upload package |
| 86 | + uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: Support ${{env.APP_VERSION}} Beta (${{ env.APP_BUILD_NUMBER }}) |
| 89 | + path: build/ |
| 90 | + |
| 91 | + |
| 92 | + |
0 commit comments