get logs #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build macOS app | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| - "release/**" | |
| - build-pkgs | |
| paths-ignore: | |
| - "*.md" | |
| - "LICENSE" | |
| tags: | |
| - v*.*.* | |
| jobs: | |
| build-macos: | |
| runs-on: | |
| - self-hosted | |
| - macOS | |
| env: | |
| APPLE_SIGNING_IDENTITY: "Apple Distribution: defguard sp. z o.o. (82GZ7KN29J)" | |
| APPLE_SIGNING_IDENTITY_INSTALLER: "3rd Party Mac Developer Installer: defguard sp. z o.o. (82GZ7KN29J)" | |
| APPLE_PROVIDER_SHORT_NAME: "82GZ7KN29J" | |
| APPLE_ID: "kamil@defguard.net" | |
| APPLE_TEAM_ID: "82GZ7KN29J" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| # - name: Write release version | |
| # run: | | |
| # VERSION=$(echo ${GITHUB_REF_NAME#v} | cut -d '-' -f1) | |
| # echo Version: $VERSION | |
| # echo "VERSION=$VERSION" >> ${GITHUB_ENV} | |
| - name: Write release version | |
| run: | | |
| VERSION=1.6.0 | |
| echo Version: $VERSION | |
| echo "VERSION=$VERSION" >> ${GITHUB_ENV} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "pnpm" | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: echo "STORE_PATH=$(pnpm store path --silent)" >> ${GITHUB_ENV} | |
| - name: Install deps | |
| run: pnpm install --frozen-lockfile | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - name: Unlock keychain | |
| run: security -v unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" login.keychain | |
| - name: Set build number | |
| run: | | |
| sed -i '' "s,@BUILD_NUMBER@,${{ github.run_number }}," src-tauri/tauri.conf.json | |
| sed -i '' "s,@BUILD_NUMBER@,${{ github.run_number }}," swift/extension/VPNExtension.xcodeproj/project.pbxproj | |
| - name: Build app | |
| # Switch back to tauri-action when this gets merged https://github.com/tauri-apps/tauri/pull/14379 | |
| # uses: tauri-apps/tauri-action@v0 # 0.5.24 seems to be broken, TODO: update when fixed | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| # APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| run: cd src-tauri && cargo tauri build --bundles app --target universal-apple-darwin | |
| # with: | |
| # args: --target universal-apple-darwin | |
| # - name: Build installation package | |
| # run: | | |
| # security -v unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" login.keychain | |
| # xcrun productbuild --sign "${{ env.APPLE_SIGNING_IDENTITY_INSTALLER }}" --component "src-tauri/target/universal-apple-darwin/release/bundle/macos/defguard-client.app" /Applications defguard-client.pkg | |
| # xcrun altool --upload-app --type macos --file defguard-client.pkg --apiKey ${{ secrets.APPLE_API_KEY }} --apiIssuer ${{ secrets.APPLE_API_ISSUER }} | |
| # # xcrun notarytool submit --wait --apple-id ${{ env.APPLE_ID }} --password ${{ secrets.NOTARYTOOL_APP_SPECIFIC_PASSWORD }} --team-id ${{ env.APPLE_TEAM_ID }} defguard-client.pkg | |
| # # xcrun stapler staple defguard-client.pkg | |
| - name: Re-sign app for direct distribution | |
| run: | | |
| # Re-sign the app with Developer ID for direct distribution | |
| codesign --force --deep --sign "Developer ID Application: defguard sp. z o.o. (82GZ7KN29J)" \ | |
| "src-tauri/target/universal-apple-darwin/release/bundle/macos/defguard-client.app" | |
| - name: Build installation package for GitHub Release | |
| run: | | |
| # Unlock keychain again before signing (it may have auto-locked) | |
| security -v unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" login.keychain | |
| ## security set-keychain-settings -t 3600 -u login.keychain | |
| xcrun productbuild --sign "Developer ID Installer: defguard sp. z o.o. (82GZ7KN29J)" \ | |
| --component "src-tauri/target/universal-apple-darwin/release/bundle/macos/defguard-client.app" /Applications \ | |
| defguard-client.pkg | |
| # Notarize for Gatekeeper | |
| xcrun notarytool submit --wait --apple-id ${{ env.APPLE_ID }} \ | |
| --password ${{ secrets.NOTARYTOOL_APP_SPECIFIC_PASSWORD }} \ | |
| --team-id ${{ env.APPLE_TEAM_ID }} defguard-client.pkg \ | |
| --output-format json > notarization-result.json | |
| # Get the submission ID and fetch the log regardless of success/failure | |
| SUBMISSION_ID=$(cat notarization-result.json | grep -o '"id":"[^"]*"' | head -1 | cut -d'"' -f4) | |
| if [ -n "$SUBMISSION_ID" ]; then | |
| echo "Fetching notarization log for submission: $SUBMISSION_ID" | |
| xcrun notarytool log "$SUBMISSION_ID" --apple-id ${{ env.APPLE_ID }} \ | |
| --password ${{ secrets.NOTARYTOOL_APP_SPECIFIC_PASSWORD }} \ | |
| --team-id ${{ env.APPLE_TEAM_ID }} notarization-log.json || true | |
| fi | |
| xcrun stapler staple defguard-client.pkg | |
| # - name: Upload installation package | |
| # uses: actions/upload-release-asset@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| # asset_path: defguard-client.pkg | |
| # asset_name: defguard-client-universal-${{ env.VERSION }}.pkg | |
| # asset_content_type: application/octet-stream |