From d475aaec1eeeffa38cba96bd8f1ccf56babbb899 Mon Sep 17 00:00:00 2001 From: galargh Date: Sat, 15 Mar 2025 10:20:47 +0000 Subject: [PATCH 01/12] ci: upload release again before the release is published --- .github/workflows/release-check.yml | 33 +---------- .github/workflows/releaser.yml | 19 +++++- .github/workflows/upload-release-assets.yml | 66 +++++++++++++++++++++ 3 files changed, 87 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/upload-release-assets.yml diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index cfd151631..e550665ee 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -22,33 +22,6 @@ jobs: upload-release-assets: needs: [release-check] if: fromJSON(needs.release-check.outputs.json)['Cargo.toml'] - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_INCREMENTAL: 0 - CACHE_SKIP_SAVE: ${{ matrix.push == '' || matrix.push == 'false' }} - RUSTFLAGS: -Dwarnings - strategy: - matrix: - network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs' ] - steps: - - name: Checking out - uses: actions/checkout@v4 - - name: Setting up cache - uses: pl-strflt/rust-sccache-action@v1 - env: - SCCACHE_CACHE_SIZE: 2G - SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache - CACHE_SKIP_SAVE: true - - name: Writing bundle - env: - BUILD_FIL_NETWORK: ${{ matrix.network }} - run: | - make bundle-repro - - name: Upload release assets to GitHub Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_RELEASE_URL: ${{ github.api_url }}/repos/${{ github.repository }}/releases/${{ fromJSON(needs.release-check.outputs.json)['Cargo.toml'].id }} - BUILD_FIL_NETWORK: ${{ matrix.network }} - run: | - ./scripts/upload-release-assets.sh + uses: ./.github/workflows/upload-release-assets.yml + with: + tag_name: ${{ fromJSON(needs.release-check.outputs.json)['Cargo.toml'].id }} diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index a95658ea4..dec8c2714 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -9,13 +9,30 @@ permissions: contents: write concurrency: - group: ${{ github.workflow }}-${{ github.sha }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }} cancel-in-progress: true jobs: + # Create/update a draft release if this is a release creating push event + draft: + uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0 + with: + sources: '["Cargo.toml"]' + draft: true + # If a draft release was created/updated, build and upload release assets + upload-release-assets: + needs: [draft] + if: fromJSON(needs.draft.outputs.json)['Cargo.toml'] + uses: ./.github/workflows/upload-release-assets.yml + with: + tag_name: ${{ fromJSON(needs.draft.outputs.json)['Cargo.toml'].id }} + # If a draft release was created/update, publish the release releaser: + needs: [draft] + if: fromJSON(needs.draft.outputs.json)['Cargo.toml'] uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0 with: sources: '["Cargo.toml"]' + draft: false secrets: UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }} diff --git a/.github/workflows/upload-release-assets.yml b/.github/workflows/upload-release-assets.yml new file mode 100644 index 000000000..b9645dba9 --- /dev/null +++ b/.github/workflows/upload-release-assets.yml @@ -0,0 +1,66 @@ +name: Upload Release Assets + +on: + workflow_dispatch: + inputs: + tag_name: + description: 'The name of the tag to upload assets for' + required: true + type: string + workflow_call: + inputs: + tag_name: + required: true + type: string + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ inputs.tag_name || github.ref }} + cancel-in-progress: true + +jobs: + upload-release-assets: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_INCREMENTAL: 0 + CACHE_SKIP_SAVE: true + RUSTFLAGS: -Dwarnings + strategy: + matrix: + network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs' ] + steps: + - id: tag + env: + TAG_NAME: ${{ inputs.tag_name }} + run: | + if [[ "$TAG_NAME" != '' ]]; then + echo "name=$TAG_NAME" | tee -a "$GITHUB_OUTPUT" + else + echo "name=${GITHUB_REF#refs/tags/}" | tee -a "$GITHUB_OUTPUT" + fi + - name: Checking out the release + uses: actions/checkout@v4 + with: + ref: ${{ format('refs/tags/{0}', steps.tag.outputs.name) }} + - name: Setting up cache + uses: pl-strflt/rust-sccache-action@v1 + env: + SCCACHE_CACHE_SIZE: 2G + SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache + CACHE_SKIP_SAVE: true + - name: Writing bundle + env: + BUILD_FIL_NETWORK: ${{ matrix.network }} + run: | + make bundle-repro + - name: Upload release assets to GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_RELEASE_URL: ${{ github.api_url }}/repos/${{ github.repository }}/releases/${{ steps.tag.outputs.name }} + BUILD_FIL_NETWORK: ${{ matrix.network }} + run: | + git checkout $GITHUB_REF -- scripts/upload-release-assets.sh + ./scripts/upload-release-assets.sh From 0b99005402d7e68c8349dd365be547773218d824 Mon Sep 17 00:00:00 2001 From: galargh Date: Sat, 15 Mar 2025 17:26:32 +0000 Subject: [PATCH 02/12] fix: wait for release assets upload before publishing --- .github/workflows/releaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index dec8c2714..652c8fbb1 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -28,7 +28,7 @@ jobs: tag_name: ${{ fromJSON(needs.draft.outputs.json)['Cargo.toml'].id }} # If a draft release was created/update, publish the release releaser: - needs: [draft] + needs: [draft, upload-release-assets] if: fromJSON(needs.draft.outputs.json)['Cargo.toml'] uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0 with: From f276fd89be10059267cee3574a1ebe025c185045 Mon Sep 17 00:00:00 2001 From: galargh Date: Sat, 15 Mar 2025 17:27:27 +0000 Subject: [PATCH 03/12] ci: do not upload release assets to a release in a pr --- .github/workflows/release-check.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index e550665ee..6e29d7ad5 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -19,9 +19,3 @@ jobs: uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@v1.0 with: sources: '["Cargo.toml"]' - upload-release-assets: - needs: [release-check] - if: fromJSON(needs.release-check.outputs.json)['Cargo.toml'] - uses: ./.github/workflows/upload-release-assets.yml - with: - tag_name: ${{ fromJSON(needs.release-check.outputs.json)['Cargo.toml'].id }} From 28b585541f46b19272bf84a815e05bc783514411 Mon Sep 17 00:00:00 2001 From: galargh Date: Sat, 15 Mar 2025 17:39:41 +0000 Subject: [PATCH 04/12] fix: take release id and ref as an input to the upload release assets workflow --- .github/workflows/releaser.yml | 2 +- .github/workflows/upload-release-assets.yml | 30 ++++++++++----------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index 652c8fbb1..b41a339a8 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -25,7 +25,7 @@ jobs: if: fromJSON(needs.draft.outputs.json)['Cargo.toml'] uses: ./.github/workflows/upload-release-assets.yml with: - tag_name: ${{ fromJSON(needs.draft.outputs.json)['Cargo.toml'].id }} + release_id: ${{ fromJSON(needs.draft.outputs.json)['Cargo.toml'].id }} # If a draft release was created/update, publish the release releaser: needs: [draft, upload-release-assets] diff --git a/.github/workflows/upload-release-assets.yml b/.github/workflows/upload-release-assets.yml index b9645dba9..b7f7d6d2c 100644 --- a/.github/workflows/upload-release-assets.yml +++ b/.github/workflows/upload-release-assets.yml @@ -3,21 +3,28 @@ name: Upload Release Assets on: workflow_dispatch: inputs: - tag_name: - description: 'The name of the tag to upload assets for' + release_id: + description: 'The id of the release to upload the assets for' required: true type: string + release_ref: + description: 'The ref to build the release assets from' + required: false + type: string workflow_call: inputs: - tag_name: + release_id: required: true type: string + release_ref: + required: false + type: string permissions: contents: write concurrency: - group: ${{ github.workflow }}-${{ inputs.tag_name || github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }} cancel-in-progress: true jobs: @@ -32,19 +39,10 @@ jobs: matrix: network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs' ] steps: - - id: tag - env: - TAG_NAME: ${{ inputs.tag_name }} - run: | - if [[ "$TAG_NAME" != '' ]]; then - echo "name=$TAG_NAME" | tee -a "$GITHUB_OUTPUT" - else - echo "name=${GITHUB_REF#refs/tags/}" | tee -a "$GITHUB_OUTPUT" - fi - - name: Checking out the release + - name: Checking out builtin-actors uses: actions/checkout@v4 with: - ref: ${{ format('refs/tags/{0}', steps.tag.outputs.name) }} + ref: ${{ inputs.release_ref || github.ref }} - name: Setting up cache uses: pl-strflt/rust-sccache-action@v1 env: @@ -59,7 +57,7 @@ jobs: - name: Upload release assets to GitHub Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_RELEASE_URL: ${{ github.api_url }}/repos/${{ github.repository }}/releases/${{ steps.tag.outputs.name }} + GITHUB_RELEASE_URL: ${{ github.api_url }}/repos/${{ github.repository }}/releases/${{ inputs.release_id }} BUILD_FIL_NETWORK: ${{ matrix.network }} run: | git checkout $GITHUB_REF -- scripts/upload-release-assets.sh From b971537b14ba008df2e330ce56c96a853bd69cc3 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 17 Mar 2025 10:28:06 -0700 Subject: [PATCH 05/12] doc: update release docs Releases are now built on merge. And, from what I can tell, they _should_ be built even if/when we bypass the merge process. --- RELEASE.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 0af761a59..eb45da409 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,21 +9,18 @@ This document describes the process for releasing a new version of the `builtin- 2. On pull request creation, a [Release Checker](.github/workflows/release-check.yml) workflow will run. It will perform the following actions: 1. Extract the version from the top-level `Cargo.toml` file. 2. Check if a git tag for the version already exists. Continue only if it does not. - 3. Create a draft GitHub release with the version as the tag. (A git tag with this version string will be created when the release is published.) + 3. Create a draft GitHub release with the version as the tag. (A git tag with this version string will be created when the release is published.) 4. Comment on the pull request with a link to the draft release. - 5. Build `builtin-actors.car`s for various networks. - 6. Generate checksums for the built `builtin-actors.car`s. - 7. Upload the built `builtin-actors.car`s and checksums as assets to the draft release (replace any existing assets with the same name). -3. On pull request merge, a [Releaser](.github/workflows/release.yml) workflow will run. It will perform the following actions: +3. On pull request merge, a [Releaser](.github/workflows/releaser.yml) workflow will run. It will perform the following actions: 1. Extract the version from the top-level `Cargo.toml` file. 2. Check if a git tag for the version already exists. Continue only if it does not. - 3. Check if a draft GitHub release with the version as the tag exists. - 4. If the draft release exists, publish it. Otherwise, create and publish a new release with the version as the git tag. Publishing the release creates the git tag. + 3. Check if a draft GitHub release with the version as the tag exists. Otherwise, create it. + 4. Trigger the [Upload Release Assets](.github/workflows/upload-release-assets.yml) workflow to: + 1. Build `builtin-actors.car`s for various networks. + 2. Generate checksums for the built `builtin-actors.car`s. + 3. Upload the built `builtin-actors.car`s and checksums as assets to the draft release. + 5. Publish the draft release. Publishing the release creates the git tag. ## Known Limitations -1. If one pushes an update to the `workspace.package.version` in the top-level `Cargo.toml` file without creating a pull request, the Release Checker workflow will not run. Hence, the release assets will not be automatically built and uploaded. - -## Possible Improvements - -1. Add a check to the [Releaser](.github/workflows/release.yml) workflow to ensure that the created/published release contains the expected assets. If it does not, create them and run the [upload-release-assets.sh](scripts/upload-release-assets.sh) script to upload the missing assets. +1. Unless triggered manually, release assets will only be built after merging the release PR. From 6b27fd95799aade53e3fbc8fe7f1f569f5628b36 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Tue, 18 Mar 2025 14:19:59 +0100 Subject: [PATCH 06/12] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 98e8548a4..bd731bf3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ ] [workspace.package] -version = "16.0.0-rc2" +version = "16.0.0-rc3" license = "MIT OR Apache-2.0" edition = "2021" repository = "https://github.com/filecoin-project/builtin-actors" From a4dc63ae29fe3e3eb7e7d9c98ce274d3202771c4 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Tue, 18 Mar 2025 14:20:38 +0100 Subject: [PATCH 07/12] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 98e8548a4..f8c8b5f9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ [workspace.package] version = "16.0.0-rc2" license = "MIT OR Apache-2.0" -edition = "2021" +edition = "2022" repository = "https://github.com/filecoin-project/builtin-actors" [package] From 40d556014a7e38d7c1dc6334db87d1cd58814848 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Tue, 18 Mar 2025 14:21:56 +0100 Subject: [PATCH 08/12] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f8c8b5f9c..98e8548a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ [workspace.package] version = "16.0.0-rc2" license = "MIT OR Apache-2.0" -edition = "2022" +edition = "2021" repository = "https://github.com/filecoin-project/builtin-actors" [package] From 58ef34f9080959e9436073b07242758a124e3259 Mon Sep 17 00:00:00 2001 From: galargh Date: Tue, 18 Mar 2025 13:30:16 +0000 Subject: [PATCH 09/12] ci: fix the concurrency group of the release check --- .github/workflows/release-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 6e29d7ad5..2b511645d 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -11,7 +11,7 @@ permissions: pull-requests: write concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }} cancel-in-progress: true jobs: From 35665c7e78ee46fc1307f371f6bc887f51b0d2a4 Mon Sep 17 00:00:00 2001 From: galargh Date: Tue, 18 Mar 2025 13:38:12 +0000 Subject: [PATCH 10/12] ci: remove concurrency group from upload release assets --- .github/workflows/upload-release-assets.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/upload-release-assets.yml b/.github/workflows/upload-release-assets.yml index b7f7d6d2c..1dae65acb 100644 --- a/.github/workflows/upload-release-assets.yml +++ b/.github/workflows/upload-release-assets.yml @@ -23,10 +23,6 @@ on: permissions: contents: write -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }} - cancel-in-progress: true - jobs: upload-release-assets: runs-on: ubuntu-latest From f50ec848fa3530e28500c60ffb1e9afb150afd96 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Tue, 18 Mar 2025 14:51:15 +0100 Subject: [PATCH 11/12] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bd731bf3c..5b9920a75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ ] [workspace.package] -version = "16.0.0-rc3" +version = "16.0.0-rc4" license = "MIT OR Apache-2.0" edition = "2021" repository = "https://github.com/filecoin-project/builtin-actors" From a51bd30048c149ec66890e90f6070924031ec01c Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Tue, 18 Mar 2025 14:59:15 +0100 Subject: [PATCH 12/12] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5b9920a75..f255e9d52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ ] [workspace.package] -version = "16.0.0-rc4" +version = "16.0.0-rc5" license = "MIT OR Apache-2.0" edition = "2021" repository = "https://github.com/filecoin-project/builtin-actors"