|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + tag_name: |
| 10 | + description: 'Release tag to publish, for example v0.3.0' |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: write |
| 16 | + |
| 17 | +jobs: |
| 18 | + verify: |
| 19 | + name: Verify release gates |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 45 |
| 22 | + steps: |
| 23 | + - name: Check out repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set up Node |
| 27 | + uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version: '22' |
| 30 | + cache: npm |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: npm ci |
| 34 | + |
| 35 | + - name: Audit release configuration |
| 36 | + run: npm run release:audit |
| 37 | + |
| 38 | + - name: Build |
| 39 | + run: npm run build |
| 40 | + |
| 41 | + - name: Runtime tests |
| 42 | + run: npm run test:runtime |
| 43 | + |
| 44 | + - name: UI smoke |
| 45 | + run: npm run ui:smoke |
| 46 | + |
| 47 | + - name: UI maturity gate |
| 48 | + run: npm run ui:maturity-gate |
| 49 | + |
| 50 | + - name: Agent benchmark |
| 51 | + run: npm run agent:benchmark |
| 52 | + |
| 53 | + mac: |
| 54 | + name: Build macOS release |
| 55 | + needs: verify |
| 56 | + runs-on: macos-latest |
| 57 | + timeout-minutes: 90 |
| 58 | + env: |
| 59 | + APPLE_ID: ${{ secrets.APPLE_ID }} |
| 60 | + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} |
| 61 | + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} |
| 62 | + CSC_LINK: ${{ secrets.MAC_CSC_LINK }} |
| 63 | + CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} |
| 64 | + steps: |
| 65 | + - name: Check out repository |
| 66 | + uses: actions/checkout@v4 |
| 67 | + |
| 68 | + - name: Set up Node |
| 69 | + uses: actions/setup-node@v4 |
| 70 | + with: |
| 71 | + node-version: '22' |
| 72 | + cache: npm |
| 73 | + |
| 74 | + - name: Install dependencies |
| 75 | + run: npm ci |
| 76 | + |
| 77 | + - name: Build split-architecture macOS artifacts |
| 78 | + run: npm run dist:mac:split |
| 79 | + |
| 80 | + - name: Verify macOS update metadata |
| 81 | + run: npm run release:verify-mac-updates |
| 82 | + |
| 83 | + - name: Restore Electron native ABI |
| 84 | + if: always() |
| 85 | + run: npm run rebuild:native:force |
| 86 | + |
| 87 | + - name: Upload macOS artifacts |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: funplay-macos |
| 91 | + if-no-files-found: error |
| 92 | + path: | |
| 93 | + release/*.dmg |
| 94 | + release/*.dmg.blockmap |
| 95 | + release/*.zip |
| 96 | + release/*.zip.blockmap |
| 97 | + release/latest-mac.yml |
| 98 | + release/latest-mac-arm64.yml |
| 99 | + release/latest-mac-x64.yml |
| 100 | +
|
| 101 | + windows: |
| 102 | + name: Build Windows release |
| 103 | + needs: verify |
| 104 | + runs-on: windows-latest |
| 105 | + timeout-minutes: 75 |
| 106 | + steps: |
| 107 | + - name: Check out repository |
| 108 | + uses: actions/checkout@v4 |
| 109 | + |
| 110 | + - name: Set up Node |
| 111 | + uses: actions/setup-node@v4 |
| 112 | + with: |
| 113 | + node-version: '22' |
| 114 | + cache: npm |
| 115 | + |
| 116 | + - name: Install dependencies |
| 117 | + run: npm ci |
| 118 | + |
| 119 | + - name: Build Windows x64 artifacts |
| 120 | + run: npm run dist:win:x64 |
| 121 | + |
| 122 | + - name: Restore Electron native ABI |
| 123 | + if: always() |
| 124 | + run: npm run rebuild:native:force |
| 125 | + |
| 126 | + - name: Upload Windows artifacts |
| 127 | + uses: actions/upload-artifact@v4 |
| 128 | + with: |
| 129 | + name: funplay-windows |
| 130 | + if-no-files-found: error |
| 131 | + path: | |
| 132 | + release/*.exe |
| 133 | + release/*.exe.blockmap |
| 134 | + release/latest.yml |
| 135 | +
|
| 136 | + publish: |
| 137 | + name: Publish draft GitHub Release |
| 138 | + needs: |
| 139 | + - mac |
| 140 | + - windows |
| 141 | + runs-on: ubuntu-latest |
| 142 | + timeout-minutes: 15 |
| 143 | + env: |
| 144 | + GH_TOKEN: ${{ github.token }} |
| 145 | + RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || github.ref_name }} |
| 146 | + steps: |
| 147 | + - name: Download release artifacts |
| 148 | + uses: actions/download-artifact@v4 |
| 149 | + with: |
| 150 | + path: artifacts |
| 151 | + |
| 152 | + - name: Create or update draft release |
| 153 | + run: | |
| 154 | + set -euo pipefail |
| 155 | + mapfile -d '' files < <(find artifacts -type f -print0 | sort -z) |
| 156 | + if [ "${#files[@]}" -eq 0 ]; then |
| 157 | + echo "No release artifacts found." |
| 158 | + exit 1 |
| 159 | + fi |
| 160 | +
|
| 161 | + title="Funplay ${RELEASE_TAG#v}" |
| 162 | + notes=$'Automated Funplay desktop release artifacts.\n\nReview macOS notarization, Windows installer behavior, and update metadata before publishing this draft release.' |
| 163 | +
|
| 164 | + if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then |
| 165 | + gh release upload "$RELEASE_TAG" "${files[@]}" --clobber |
| 166 | + else |
| 167 | + gh release create "$RELEASE_TAG" "${files[@]}" --draft --title "$title" --notes "$notes" |
| 168 | + fi |
0 commit comments