|
61 | 61 | run: pnpm typecheck |
62 | 62 |
|
63 | 63 | - name: Test |
64 | | - run: pnpm -r test |
| 64 | + run: pnpm test |
65 | 65 |
|
66 | 66 | # ------------------------------------------------------------------ |
67 | 67 | # Changelog: build release notes from conventional commits. |
@@ -175,12 +175,134 @@ jobs: |
175 | 175 | if-no-files-found: error |
176 | 176 | retention-days: 7 |
177 | 177 |
|
| 178 | + # ------------------------------------------------------------------ |
| 179 | + # Snap: best-effort build of a .snap on ubuntu using snapcraft. |
| 180 | + # Isolated into its own job because snapcraft is heavyweight and |
| 181 | + # occasionally flakes on hosted runners; failure here should NOT |
| 182 | + # block the release (publish job does not `needs:` this one). |
| 183 | + # ------------------------------------------------------------------ |
| 184 | + build-snap: |
| 185 | + name: Build Linux Snap (best-effort) |
| 186 | + needs: [gate] |
| 187 | + runs-on: ubuntu-latest |
| 188 | + continue-on-error: true |
| 189 | + env: |
| 190 | + RELEASE_REF: ${{ github.event_name == 'push' && github.ref || format('refs/tags/{0}', inputs.tag) }} |
| 191 | + steps: |
| 192 | + - uses: actions/checkout@v4 |
| 193 | + with: |
| 194 | + ref: ${{ env.RELEASE_REF }} |
| 195 | + fetch-depth: 0 |
| 196 | + |
| 197 | + - name: Setup pnpm |
| 198 | + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 |
| 199 | + |
| 200 | + - name: Setup Node |
| 201 | + uses: actions/setup-node@v4 |
| 202 | + with: |
| 203 | + node-version-file: .nvmrc |
| 204 | + cache: pnpm |
| 205 | + |
| 206 | + - name: Install |
| 207 | + run: pnpm install --frozen-lockfile |
| 208 | + |
| 209 | + - name: Install snapcraft + LXD |
| 210 | + # snapcraft itself handles most simple electron-builder builds via |
| 211 | + # `snap pack`, but recent electron-builder (post core22/core24) will |
| 212 | + # fall back to invoking snapcraft which needs LXD for its build |
| 213 | + # environment. Setting both up here keeps the step resilient. |
| 214 | + run: | |
| 215 | + sudo snap install snapcraft --classic |
| 216 | + sudo snap install lxd |
| 217 | + sudo lxd waitready --timeout=60 |
| 218 | + sudo lxd init --auto |
| 219 | +
|
| 220 | + - name: Build workspace |
| 221 | + run: pnpm --filter '!@open-codesign/desktop' -r build |
| 222 | + |
| 223 | + - name: Package snap |
| 224 | + working-directory: apps/desktop |
| 225 | + env: |
| 226 | + CSC_IDENTITY_AUTO_DISCOVERY: 'false' |
| 227 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 228 | + run: pnpm exec electron-vite build && pnpm exec electron-builder --linux snap --publish never |
| 229 | + |
| 230 | + - name: Upload snap artifact |
| 231 | + uses: actions/upload-artifact@v4 |
| 232 | + with: |
| 233 | + name: installer-snap |
| 234 | + path: apps/desktop/release/*.snap |
| 235 | + if-no-files-found: warn |
| 236 | + retention-days: 7 |
| 237 | + |
| 238 | + # ------------------------------------------------------------------ |
| 239 | + # Supply-chain: checksums + CycloneDX SBOM for the whole workspace. |
| 240 | + # Runs on one runner after all platform artifacts are uploaded. |
| 241 | + # ------------------------------------------------------------------ |
| 242 | + provenance: |
| 243 | + name: Checksums + SBOM |
| 244 | + needs: [build, build-snap] |
| 245 | + runs-on: ubuntu-latest |
| 246 | + env: |
| 247 | + RELEASE_REF: ${{ github.event_name == 'push' && github.ref || format('refs/tags/{0}', inputs.tag) }} |
| 248 | + steps: |
| 249 | + - uses: actions/checkout@v4 |
| 250 | + with: |
| 251 | + ref: ${{ env.RELEASE_REF }} |
| 252 | + fetch-depth: 0 |
| 253 | + |
| 254 | + - name: Setup pnpm |
| 255 | + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 |
| 256 | + |
| 257 | + - name: Setup Node |
| 258 | + uses: actions/setup-node@v4 |
| 259 | + with: |
| 260 | + node-version-file: .nvmrc |
| 261 | + cache: pnpm |
| 262 | + |
| 263 | + - name: Install |
| 264 | + run: pnpm install --frozen-lockfile |
| 265 | + |
| 266 | + - name: Download all installers |
| 267 | + uses: actions/download-artifact@v4 |
| 268 | + with: |
| 269 | + path: dist/ |
| 270 | + merge-multiple: true |
| 271 | + |
| 272 | + - name: Generate CycloneDX SBOM (workspace) |
| 273 | + uses: anchore/sbom-action@v0 |
| 274 | + with: |
| 275 | + path: . |
| 276 | + format: cyclonedx-json |
| 277 | + output-file: dist/open-codesign-${{ github.event_name == 'push' && github.ref_name || inputs.tag }}-sbom.cdx.json |
| 278 | + |
| 279 | + - name: Generate SHA256SUMS.txt |
| 280 | + working-directory: dist |
| 281 | + run: | |
| 282 | + shopt -s nullglob |
| 283 | + : > SHA256SUMS.txt |
| 284 | + for f in *; do |
| 285 | + [ -f "$f" ] && [ "$f" != "SHA256SUMS.txt" ] || continue |
| 286 | + sha256sum "$f" >> SHA256SUMS.txt |
| 287 | + done |
| 288 | + cat SHA256SUMS.txt |
| 289 | +
|
| 290 | + - name: Upload provenance artifacts |
| 291 | + uses: actions/upload-artifact@v4 |
| 292 | + with: |
| 293 | + name: provenance |
| 294 | + path: | |
| 295 | + dist/SHA256SUMS.txt |
| 296 | + dist/open-codesign-*-sbom.cdx.json |
| 297 | + if-no-files-found: error |
| 298 | + retention-days: 7 |
| 299 | + |
178 | 300 | # ------------------------------------------------------------------ |
179 | 301 | # Publish: create (or update draft) GitHub Release and attach files. |
180 | 302 | # ------------------------------------------------------------------ |
181 | 303 | publish: |
182 | 304 | name: Publish GitHub Release |
183 | | - needs: [build, changelog] |
| 305 | + needs: [build, build-snap, changelog, provenance] |
184 | 306 | runs-on: ubuntu-latest |
185 | 307 | env: |
186 | 308 | RELEASE_REF: ${{ github.event_name == 'push' && github.ref || format('refs/tags/{0}', inputs.tag) }} |
@@ -221,3 +343,66 @@ jobs: |
221 | 343 | fail_on_unmatched_files: false |
222 | 344 | env: |
223 | 345 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 346 | + |
| 347 | + # ------------------------------------------------------------------ |
| 348 | + # Homebrew Cask bump — opens a PR against OpenCoworkAI/homebrew-tap |
| 349 | + # with the new version + sha256 of the mac DMGs. |
| 350 | + # Skipped until HOMEBREW_TAP_TOKEN is set (see packaging/homebrew/README.md). |
| 351 | + # ------------------------------------------------------------------ |
| 352 | + homebrew: |
| 353 | + name: Bump Homebrew Cask |
| 354 | + needs: [publish] |
| 355 | + runs-on: macos-latest |
| 356 | + if: github.event_name == 'push' && !contains(github.ref_name, '-') |
| 357 | + steps: |
| 358 | + - name: Guard on secret |
| 359 | + id: guard |
| 360 | + run: | |
| 361 | + if [ -z "${{ secrets.HOMEBREW_TAP_TOKEN }}" ]; then |
| 362 | + echo "skip=true" >> "$GITHUB_OUTPUT" |
| 363 | + echo "::notice::HOMEBREW_TAP_TOKEN not set — skipping Homebrew bump. See packaging/homebrew/README.md." |
| 364 | + else |
| 365 | + echo "skip=false" >> "$GITHUB_OUTPUT" |
| 366 | + fi |
| 367 | +
|
| 368 | + - name: Bump cask |
| 369 | + if: steps.guard.outputs.skip == 'false' |
| 370 | + # TODO: pin to commit SHA when flipping HOMEBREW_TAP_TOKEN on (Scorecard). |
| 371 | + uses: macauley/action-homebrew-bump-cask@v1 |
| 372 | + with: |
| 373 | + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} |
| 374 | + tap: OpenCoworkAI/homebrew-tap |
| 375 | + cask: open-codesign |
| 376 | + tag: ${{ github.ref_name }} |
| 377 | + force: false |
| 378 | + |
| 379 | + # ------------------------------------------------------------------ |
| 380 | + # winget manifest PR — submits to microsoft/winget-pkgs. |
| 381 | + # Skipped until WINGET_PAT is set (see packaging/winget/). |
| 382 | + # Requires initial manual submission of the manifest first. |
| 383 | + # ------------------------------------------------------------------ |
| 384 | + winget: |
| 385 | + name: Submit winget manifest |
| 386 | + needs: [publish] |
| 387 | + runs-on: windows-latest |
| 388 | + if: github.event_name == 'push' && !contains(github.ref_name, '-') |
| 389 | + steps: |
| 390 | + - name: Guard on secret |
| 391 | + id: guard |
| 392 | + shell: bash |
| 393 | + run: | |
| 394 | + if [ -z "${{ secrets.WINGET_PAT }}" ]; then |
| 395 | + echo "skip=true" >> "$GITHUB_OUTPUT" |
| 396 | + echo "::notice::WINGET_PAT not set — skipping winget submission. See packaging/winget/." |
| 397 | + else |
| 398 | + echo "skip=false" >> "$GITHUB_OUTPUT" |
| 399 | + fi |
| 400 | +
|
| 401 | + - name: Release winget package |
| 402 | + if: steps.guard.outputs.skip == 'false' |
| 403 | + # TODO: pin to commit SHA when flipping WINGET_PAT on (Scorecard). |
| 404 | + uses: vedantmgoyal9/winget-releaser@v2 |
| 405 | + with: |
| 406 | + identifier: OpenCoworkAI.OpenCoDesign |
| 407 | + installers-regex: '-x64-setup\.exe$|-arm64-setup\.exe$' |
| 408 | + token: ${{ secrets.WINGET_PAT }} |
0 commit comments