macOS Build: Include gon-sign file #4
Workflow file for this run
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 & Release" | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| run: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - target: "macOS" | |
| platform: "darwin/universal" | |
| - target: "Win" | |
| platform: "windows/amd64" | |
| runs-on: >- | |
| ${{ | |
| contains(matrix.build.platform, 'windows') && 'windows-latest' || | |
| contains(matrix.build.platform, 'darwin') && 'macos-latest' || | |
| 'ubuntu-latest' | |
| }} | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=4096" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: "1.23" | |
| - name: Install node | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: "20" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| package_json_file: frontend/package.json | |
| - name: Install wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/[email protected] | |
| - name: Build app | |
| run: > | |
| wails build | |
| -clean | |
| -platform ${{ matrix.build.platform }} | |
| - name: Fix macOS binary permissions | |
| if: matrix.build.target == 'macOS' | |
| run: > | |
| chmod +x build/bin/*/Contents/MacOS/* | |
| - name: Download gon for code signing and notarization (macOS) | |
| if: matrix.build.target == 'macOS' | |
| run: | | |
| brew install Bearer/tap/gon | |
| - name: Import codesigning certificates (macOS) | |
| if: matrix.build.target == 'macOS' | |
| uses: Apple-Actions/import-codesign-certs@v1 | |
| with: | |
| p12-file-base64: ${{ secrets.APPLE_CODESIGN_CERT }} | |
| p12-password: ${{ secrets.APPLE_CODESIGN_CERT_PASSPHRASE }} | |
| - name: Codesign (macOS) | |
| if: matrix.build.target == 'macOS' | |
| env: | |
| AC_USERNAME: ${{ secrets.APPLE_CODESIGN_NOTARY_USER }} | |
| AC_PASSWORD: ${{ secrets.APPLE_CODESIGN_NOTARY_PASSWORD }} | |
| AC_PROVIDER: ${{ secrets.APPLE_CODESIGN_ACCOUNT_ID }} | |
| AC_APPLICATION_IDENTITY: ${{ secrets.APPLE_CODESIGN_APP_IDENTITY }} | |
| run: | | |
| echo "Signing package" | |
| gon -log-level=info ./build/darwin/gon-sign.json | |
| - name: Create and prepare release directory | |
| run: | | |
| mkdir -p release/pkg | |
| mkdir -p release/RailwayNetDiag_${{ matrix.build.target }} | |
| mv build/bin/* release/RailwayNetDiag_${{ matrix.build.target }}/ | |
| ls -l release/RailwayNetDiag_${{ matrix.build.target }}/ | |
| - name: Codesign (Windows) | |
| if: matrix.build.target == 'Win' | |
| uses: sslcom/esigner-codesign@develop | |
| with: | |
| command: sign | |
| username: ${{secrets.SSLCOM_USERNAME}} | |
| password: ${{secrets.SSLCOM_PASSWORD}} | |
| credential_id: ${{secrets.SSLCOM_CREDENTIAL_ID}} | |
| totp_secret: ${{secrets.SSLCOM_TOTP_SECRET}} | |
| signing_method: v1 | |
| dir_path: ${{ github.workspace }}/release/RailwayNetDiag_Win | |
| file_path: ${{ github.workspace }}/release/RailwayNetDiag_Win/RailwayNetDiag.exe | |
| override: true | |
| clean_logs: true | |
| - name: Package for release | |
| uses: thedoctor0/[email protected] | |
| with: | |
| type: zip | |
| directory: release | |
| path: RailwayNetDiag_${{ matrix.build.target }} | |
| filename: pkg/RailwayNetDiag_${{ matrix.build.target }}.zip | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: release/pkg/** |