| ... | ... | @@ -311,7 +311,9 @@ jobs: |
| 311 | 311 | shell: bash |
| 312 | 312 | run: | |
| 313 | 313 | set -euo pipefail |
| 314 | | mkdir -p release-publish |
| 314 | asset_dir="release-artifacts/desktop-${{ matrix.platform }}-${{ matrix.arch }}" |
| 315 | rm -rf "$asset_dir" |
| 316 | mkdir -p "$asset_dir" |
| 315 | 317 | |
| 316 | 318 | shopt -s nullglob |
| 317 | 319 | for pattern in \ |
| ... | ... | @@ -322,13 +324,13 @@ jobs: |
| 322 | 324 | "release/*.blockmap" \ |
| 323 | 325 | "release/*.yml"; do |
| 324 | 326 | for file in $pattern; do |
| 325 | | cp "$file" release-publish/ |
| 327 | cp "$file" "$asset_dir"/ |
| 326 | 328 | done |
| 327 | 329 | done |
| 328 | 330 | |
| 329 | 331 | if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then |
| 330 | 332 | shopt -s nullglob |
| 331 | | for manifest in release-publish/*-mac.yml; do |
| 333 | for manifest in "$asset_dir"/*-mac.yml; do |
| 332 | 334 | mv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml" |
| 333 | 335 | done |
| 334 | 336 | fi |
| ... | ... | @@ -340,17 +342,23 @@ jobs: |
| 340 | 342 | # canonical manifest per channel. |
| 341 | 343 | # if [[ "${{ matrix.platform }}" == "win" ]]; then |
| 342 | 344 | # shopt -s nullglob |
| 343 | | # for manifest in release-publish/*.yml; do |
| 345 | # for manifest in "$asset_dir"/*.yml; do |
| 344 | 346 | # mv "$manifest" "${manifest%.yml}-win-${{ matrix.arch }}.yml" |
| 345 | 347 | # done |
| 346 | 348 | # fi |
| 347 | 349 | |
| 348 | | - name: Upload build artifacts |
| 349 | | uses: actions/upload-artifact@v7 |
| 350 | assets=("$asset_dir"/*) |
| 351 | if (( ${#assets[@]} == 0 )); then |
| 352 | echo "No release assets were collected for ${{ matrix.platform }} ${{ matrix.arch }}." >&2 |
| 353 | exit 1 |
| 354 | fi |
| 355 | |
| 356 | - name: Save build artifacts |
| 357 | uses: actions/cache/save@v5 |
| 350 | 358 | with: |
| 351 | | name: desktop-${{ matrix.platform }}-${{ matrix.arch }} |
| 352 | | path: release-publish/* |
| 353 | | if-no-files-found: error |
| 359 | path: release-artifacts/desktop-${{ matrix.platform }}-${{ matrix.arch }} |
| 360 | key: release-assets-${{ github.run_id }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.run_attempt }} |
| 361 | enableCrossOsArchive: true |
| 354 | 362 | |
| 355 | 363 | publish_cli: |
| 356 | 364 | name: Publish CLI to npm |
| ... | ... | @@ -423,12 +431,70 @@ jobs: |
| 423 | 431 | - name: Install dependencies |
| 424 | 432 | run: bun install --frozen-lockfile --filter=@t3tools/scripts |
| 425 | 433 | |
| 426 | | - name: Download all desktop artifacts |
| 427 | | uses: actions/download-artifact@v8 |
| 434 | # Keep these restore steps in sync with the desktop build matrix. |
| 435 | # Cache restore cannot enumerate a key pattern like download-artifact did. |
| 436 | - name: Restore macOS arm64 desktop assets |
| 437 | uses: actions/cache/restore@v5 |
| 438 | with: |
| 439 | path: release-artifacts/desktop-mac-arm64 |
| 440 | key: release-assets-${{ github.run_id }}-mac-arm64-${{ github.run_attempt }} |
| 441 | restore-keys: | |
| 442 | release-assets-${{ github.run_id }}-mac-arm64- |
| 443 | fail-on-cache-miss: true |
| 444 | enableCrossOsArchive: true |
| 445 | |
| 446 | - name: Restore macOS x64 desktop assets |
| 447 | uses: actions/cache/restore@v5 |
| 448 | with: |
| 449 | path: release-artifacts/desktop-mac-x64 |
| 450 | key: release-assets-${{ github.run_id }}-mac-x64-${{ github.run_attempt }} |
| 451 | restore-keys: | |
| 452 | release-assets-${{ github.run_id }}-mac-x64- |
| 453 | fail-on-cache-miss: true |
| 454 | enableCrossOsArchive: true |
| 455 | |
| 456 | - name: Restore Linux x64 desktop assets |
| 457 | uses: actions/cache/restore@v5 |
| 428 | 458 | with: |
| 429 | | pattern: desktop-* |
| 430 | | merge-multiple: true |
| 431 | | path: release-assets |
| 459 | path: release-artifacts/desktop-linux-x64 |
| 460 | key: release-assets-${{ github.run_id }}-linux-x64-${{ github.run_attempt }} |
| 461 | restore-keys: | |
| 462 | release-assets-${{ github.run_id }}-linux-x64- |
| 463 | fail-on-cache-miss: true |
| 464 | enableCrossOsArchive: true |
| 465 | |
| 466 | - name: Restore Windows x64 desktop assets |
| 467 | uses: actions/cache/restore@v5 |
| 468 | with: |
| 469 | path: release-artifacts/desktop-win-x64 |
| 470 | key: release-assets-${{ github.run_id }}-win-x64-${{ github.run_attempt }} |
| 471 | restore-keys: | |
| 472 | release-assets-${{ github.run_id }}-win-x64- |
| 473 | fail-on-cache-miss: true |
| 474 | enableCrossOsArchive: true |
| 475 | |
| 476 | - name: Stage desktop assets |
| 477 | shell: bash |
| 478 | run: | |
| 479 | set -euo pipefail |
| 480 | rm -rf release-assets |
| 481 | mkdir -p release-assets |
| 482 | |
| 483 | shopt -s nullglob |
| 484 | for dir in release-artifacts/desktop-*; do |
| 485 | files=("$dir"/*) |
| 486 | if (( ${#files[@]} == 0 )); then |
| 487 | echo "No release assets were restored from $dir." >&2 |
| 488 | exit 1 |
| 489 | fi |
| 490 | cp "${files[@]}" release-assets/ |
| 491 | done |
| 492 | |
| 493 | assets=(release-assets/*) |
| 494 | if (( ${#assets[@]} == 0 )); then |
| 495 | echo "No desktop release assets were staged." >&2 |
| 496 | exit 1 |
| 497 | fi |
| 432 | 498 | |
| 433 | 499 | - name: Merge macOS updater manifests |
| 434 | 500 | run: | |