|
| 1 | +name: Build dolt-workbench for Mac |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + release-version: |
| 6 | + description: GitHub Release Version Number |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | + workflow_call: |
| 11 | + inputs: |
| 12 | + release-version: |
| 13 | + description: Github Release Version Number |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-dmg: |
| 19 | + name: Build Mac release version |
| 20 | + runs-on: macos-14 |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v3 |
| 24 | + |
| 25 | + - name: Bump build version |
| 26 | + uses: ./.github/actions/bump-build-version |
| 27 | + with: |
| 28 | + build-config-file: web/build/builder-dmg-config.yaml |
| 29 | + |
| 30 | + - uses: actions/setup-node@v4 |
| 31 | + with: |
| 32 | + node-version: "latest" |
| 33 | + |
| 34 | + - name: Install dependencies |
| 35 | + uses: ./.github/actions/install-dependencies |
| 36 | + |
| 37 | + - name: Download provisioning profiles |
| 38 | + id: download-provisioning-profiles |
| 39 | + uses: apple-actions/download-provisioning-profiles@v4 |
| 40 | + with: |
| 41 | + bundle-id: com.dolthub.dolt-workbench |
| 42 | + profile-type: MAC_APP_DEVELOPMENT |
| 43 | + issuer-id: ${{ vars.APPSTORE_ISSUER_ID }} |
| 44 | + api-key-id: ${{ vars.APPSTORE_API_KEY_ID }} |
| 45 | + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} |
| 46 | + |
| 47 | + - name: Move provision profile to build directory |
| 48 | + run: | |
| 49 | + JSON='${{ steps.download-provisioning-profiles.outputs.profiles }}' |
| 50 | + UDID=$(echo $JSON | jq -r '.[0].udid') |
| 51 | + mv "$HOME/Library/MobileDevice/Provisioning Profiles/$UDID.provisionprofile" "${{ github.workspace }}/web/build/mac/AppleDevelopment.provisionprofile" |
| 52 | +
|
| 53 | + - name: Import codesign certs |
| 54 | + uses: apple-actions/import-codesign-certs@v3 |
| 55 | + with: |
| 56 | + p12-file-base64: ${{ secrets.DEV_ID_CERT_BASE64 }} |
| 57 | + p12-password: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }} |
| 58 | + |
| 59 | + - name: Cache Next.js build |
| 60 | + uses: actions/cache@v4 |
| 61 | + with: |
| 62 | + path: | |
| 63 | + web/renderer/.next/cache |
| 64 | + web/.next/cache |
| 65 | + key: nextjs-${{ runner.os }}-${{ hashFiles('web/renderer/next.config.js', 'web/package.json', 'web/yarn.lock') }} |
| 66 | + restore-keys: | |
| 67 | + nextjs-${{ runner.os }}- |
| 68 | +
|
| 69 | + - name: Build dmg package |
| 70 | + working-directory: web |
| 71 | + env: |
| 72 | + CSC_LINK: ${{ secrets.DEV_ID_CERT_BASE64 }} |
| 73 | + CSC_KEY_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATES_PASSWORD }} |
| 74 | + run: | |
| 75 | + yarn build:dmg |
| 76 | +
|
| 77 | + - name: Create .env file for signing |
| 78 | + working-directory: web/build/mac |
| 79 | + run: | |
| 80 | + cat > .env <<'EOF' |
| 81 | + SIGNING_CERTIFICATE="Developer ID Application: DoltHub Inc (${{ vars.TEAM_ID }})" |
| 82 | + TEAM_ID="${{ vars.TEAM_ID }}" |
| 83 | + APPLE_ID="${{ vars.APPLE_ID }}" |
| 84 | + APPLE_ID_PASSWORD="${{ secrets.APPLE_ID_PASSWORD }}" |
| 85 | + EOF |
| 86 | +
|
| 87 | + - name: Sign and notarize |
| 88 | + working-directory: web |
| 89 | + run: | |
| 90 | + yarn sign-dmg |
| 91 | +
|
| 92 | + - name: Upload package to Release ${{ inputs.release-version }} |
| 93 | + uses: softprops/action-gh-release@v2 |
| 94 | + with: |
| 95 | + tag_name: v${{ inputs.release-version }} |
| 96 | + files: ${{ github.workspace }}/web/dist/DoltWorkbench-mac-arm64.dmg |
| 97 | + |
| 98 | + commit-build-version: |
| 99 | + name: Commit new build version |
| 100 | + needs: build-dmg |
| 101 | + runs-on: ubuntu-22.04 |
| 102 | + concurrency: |
| 103 | + group: commit-build-version |
| 104 | + cancel-in-progress: false |
| 105 | + steps: |
| 106 | + - uses: actions/checkout@v3 |
| 107 | + |
| 108 | + - uses: ./.github/actions/bump-build-version |
| 109 | + with: |
| 110 | + build-config-file: web/build/builder-dmg-config.yaml |
| 111 | + commit: true |
0 commit comments