From 21eb94adfb059d898adacc632e5eb2197dbd89aa Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 08:50:35 +0000 Subject: [PATCH 1/7] add release workflow --- .github/workflows/release.yml | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ae69774 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,72 @@ +name: Release + +on: + push: + tags: + - 'v*' + - '*' + +jobs: + build-and-release: + name: Build and publish release when tag points to main + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Ensure tag points to origin/main + shell: bash + run: | + TAG=${GITHUB_REF#refs/tags/} + echo "Tag: $TAG" + # Fetch main so we can check whether the tagged commit is contained in it + git fetch origin main --depth=1 || true + if git branch --remotes --contains "${GITHUB_SHA}" | grep -q "origin/main"; then + echo "Tag ${TAG} points to a commit on origin/main — continuing." + else + echo "Tag ${TAG} does not point to a commit on origin/main — skipping release." + exit 0 + fi + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Build workspace (release) + run: | + cargo build --workspace --release + + - name: Prepare release artifact + run: | + BIN=nitro-attest-cli + ART="${BIN}-${{ github.ref_name }}.tar.gz" + mkdir -p release + tar -C target/release -czf release/${ART} ${BIN} || (echo "Binary ${BIN} not found in target/release" && ls -la target/release && exit 1) + ls -lh release + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} + body: "Automated release for ${{ github.ref_name }}" + draft: false + prerelease: false + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: release/nitro-attest-cli-${{ github.ref_name }}.tar.gz + asset_name: nitro-attest-cli-${{ github.ref_name }}.tar.gz + asset_content_type: application/gzip From d8e5ecd081a0842f8b666adf4ca4953979b356c0 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 09:01:43 +0000 Subject: [PATCH 2/7] install rzup --- .github/workflows/release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae69774..9cee825 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,22 @@ jobs: toolchain: stable override: true + - name: Install Risc0 rzup and Risc0 Rust toolchain + shell: bash + run: | + # Install rzup (Risc0 toolchain manager) + curl -fsSL https://rzup.risc0.dev/install.sh | sh + # Load rzup environment for this step + source $HOME/.rzup/env + # Install Risc0's Rust toolchain required by risc0-build + rzup install rust + # Make rzup and its cargo available to subsequent steps + echo "$HOME/.rzup/bin" >> $GITHUB_PATH + echo "$HOME/.rzup/cargo/bin" >> $GITHUB_PATH + - name: Build workspace (release) + env: + RUSTUP_TOOLCHAIN: stable run: | cargo build --workspace --release From a35c3057c5eec3b860f265dba3f1b251fded46e1 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 13:27:09 +0000 Subject: [PATCH 3/7] install rzup & sp1up --- .github/workflows/release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cee825..d82502b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,19 +37,23 @@ jobs: toolchain: stable override: true - - name: Install Risc0 rzup and Risc0 Rust toolchain + - name: Install RISC0 toolchain (rzup) shell: bash run: | - # Install rzup (Risc0 toolchain manager) - curl -fsSL https://rzup.risc0.dev/install.sh | sh - # Load rzup environment for this step + curl -L https://risczero.com/install | bash source $HOME/.rzup/env - # Install Risc0's Rust toolchain required by risc0-build rzup install rust - # Make rzup and its cargo available to subsequent steps echo "$HOME/.rzup/bin" >> $GITHUB_PATH echo "$HOME/.rzup/cargo/bin" >> $GITHUB_PATH + - name: Install SP1 toolchain (sp1up) + shell: bash + run: | + curl -L https://sp1up.succinct.xyz | bash + source $HOME/.sp1/env + sp1up install + echo "$HOME/.sp1/bin" >> $GITHUB_PATH + - name: Build workspace (release) env: RUSTUP_TOOLCHAIN: stable From 76afe27c6f6b8d34ef5b29399a0e2e557df84021 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 13:30:27 +0000 Subject: [PATCH 4/7] install rzup & sp1up --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d82502b..9200b1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,16 +41,16 @@ jobs: shell: bash run: | curl -L https://risczero.com/install | bash - source $HOME/.rzup/env + source $HOME/.bashrc rzup install rust - echo "$HOME/.rzup/bin" >> $GITHUB_PATH - echo "$HOME/.rzup/cargo/bin" >> $GITHUB_PATH + echo "$HOME/.risc0/bin" >> $GITHUB_PATH + echo "$HOME/.risc0/cargo/bin" >> $GITHUB_PATH - name: Install SP1 toolchain (sp1up) shell: bash run: | curl -L https://sp1up.succinct.xyz | bash - source $HOME/.sp1/env + source $HOME/.bashrc sp1up install echo "$HOME/.sp1/bin" >> $GITHUB_PATH From a431ca46049a07340b2b9098f325d18c43d0bf9b Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 13:34:16 +0000 Subject: [PATCH 5/7] install rzup & sp1up --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9200b1e..060fc85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: shell: bash run: | curl -L https://risczero.com/install | bash - source $HOME/.bashrc + export PATH="$HOME/.risc0/bin:$PATH" rzup install rust echo "$HOME/.risc0/bin" >> $GITHUB_PATH echo "$HOME/.risc0/cargo/bin" >> $GITHUB_PATH @@ -50,7 +50,7 @@ jobs: shell: bash run: | curl -L https://sp1up.succinct.xyz | bash - source $HOME/.bashrc + export PATH="$HOME/.sp1/bin:$PATH" sp1up install echo "$HOME/.sp1/bin" >> $GITHUB_PATH From 53951375b490c88888617146f9993e31744a76f2 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 13:36:51 +0000 Subject: [PATCH 6/7] update workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 060fc85..8b16dc4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: run: | curl -L https://sp1up.succinct.xyz | bash export PATH="$HOME/.sp1/bin:$PATH" - sp1up install + sp1up echo "$HOME/.sp1/bin" >> $GITHUB_PATH - name: Build workspace (release) From 91e071088309caae89afeb090422a5df9f70f104 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 6 Nov 2025 14:06:55 +0000 Subject: [PATCH 7/7] replace release action --- .github/workflows/release.yml | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b16dc4..f52b647 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,24 +68,11 @@ jobs: tar -C target/release -czf release/${ART} ${BIN} || (echo "Binary ${BIN} not found in target/release" && ls -la target/release && exit 1) ls -lh release - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create GitHub Release and upload assets + uses: softprops/action-gh-release@v2 with: - tag_name: ${{ github.ref_name }} - release_name: ${{ github.ref_name }} + files: release/nitro-attest-cli-${{ github.ref_name }}.tar.gz body: "Automated release for ${{ github.ref_name }}" draft: false prerelease: false - - - name: Upload release asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: release/nitro-attest-cli-${{ github.ref_name }}.tar.gz - asset_name: nitro-attest-cli-${{ github.ref_name }}.tar.gz - asset_content_type: application/gzip + fail_on_unmatched_files: true