From d62c6d9b8e457a41123e165c0dbbeac14b39fac1 Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 14:47:33 +0530 Subject: [PATCH 01/12] add untested release workflow --- .github/workflows/release.yml | 123 ++++++++++++++++++++++++++++++++++ 1 file changed, 123 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..561c2df --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,123 @@ +name: release-relayer + +on: + push: + branches: + "*" + workflow_dispatch: + inputs: + runtime_version: + type: string + description: Latest runtime version compatible with + message: + required: true + snowbridge_version: + type: string + description: Linked snowbridge version + +jobs: + release-relayer: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "14" + + - name: Setup go + uses: actions/checkout@v4 + with: + go-version: "^1.21.0" + + - name: Install Go tools + run: > + go install github.com/magefile/mage@v1.15.0 && + go install github.com/ferranbt/fastssz/sszgen@v0.1.3 && + go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.8 + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Install dependencies + working-directory: relayer + run: go mod download + + - name: Add gopath to bin + run: echo "$HOME/go/bin" >> $GITHUB_PATH + + - name: Build + working-directory: relayer + run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 mage build + + - name: Configure Git + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + + - name: Determine new version + id: new_version + run: | + # Get the most recent tag in the format relayer-v + current_tag=$(git tag --list "relayer-v*" --sort=-v:refname | head -n 1) + new_tag="relayer-v${{ inputs.snowbridge_version }}-${{ inputs.runtime_version }}" + + echo "New tag: $new_tag" + echo "new_tag=$new_tag" >> $GITHUB_OUTPUT + echo "from_tag=$current_tag" >> $GITHUB_OUTPUT + + - name: Create new tag + id: create_tag + run: | + tag_name="${{ steps.new_version.outputs.new_tag }}" + echo "Tag name: $tag_name" + echo "tag=$tag_name" >> $GITHUB_OUTPUT + git tag $tag_name + + - name: Push new tag + run: | + git push origin --tags + + - name: "Build Changelog" + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v4 + with: + configurationJson: | + { + "template": "#{{CHANGELOG}}\n\n
\n
", + "categories": [ + { + "title": "## Relayer Changes", + "labels": ["Component: Relayer"] + } + ] + } + fromTag: ${{ steps.new_version.outputs.from_tag }} + toTag: ${{ steps.create_tag.outputs.tag }} + + - name: Create a GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.create_tag.outputs.tag }} + release_name: ${{ steps.create_tag.outputs.tag }} + body: | + ${{steps.build_changelog.outputs.changelog}} + 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: ./build/tanssi-bridge-relayer + asset_name: tanssi-bridge-relayer + asset_content_type: application/octet-stream From 7369fc12b07dd27ee5e8c990fe53f0e22c4c551e Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 15:18:58 +0530 Subject: [PATCH 02/12] remove push --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 561c2df..95c6e59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,6 @@ name: release-relayer on: - push: - branches: - "*" workflow_dispatch: inputs: runtime_version: From c086f152d2586c7f9877db698892a889ba877a7b Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 15:22:07 +0530 Subject: [PATCH 03/12] remove message input --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95c6e59..f9ccbc4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,6 @@ on: runtime_version: type: string description: Latest runtime version compatible with - message: - required: true snowbridge_version: type: string description: Linked snowbridge version From 340330d7a1cc8135a088497ec1a7fae8bbc5999e Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 15:26:24 +0530 Subject: [PATCH 04/12] remove working-directory --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9ccbc4..00c2f26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,14 +39,12 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 - name: Install dependencies - working-directory: relayer run: go mod download - name: Add gopath to bin run: echo "$HOME/go/bin" >> $GITHUB_PATH - name: Build - working-directory: relayer run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 mage build - name: Configure Git From 1c5ddeb4d9abcb2c4972b71a0e15b605f917025f Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 15:33:49 +0530 Subject: [PATCH 05/12] also download submodules --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00c2f26..6df5548 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/checkout@v1 with: fetch-depth: 2 + submodules: 'true' - name: Set up Node.js uses: actions/setup-node@v2 From d6386c4606c69c9770d74c7f2fb1cd8f4ec83623 Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 15:55:06 +0530 Subject: [PATCH 06/12] print current tag as well --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6df5548..60afa27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: fetch-depth: 2 submodules: 'true' @@ -59,7 +59,8 @@ jobs: # Get the most recent tag in the format relayer-v current_tag=$(git tag --list "relayer-v*" --sort=-v:refname | head -n 1) new_tag="relayer-v${{ inputs.snowbridge_version }}-${{ inputs.runtime_version }}" - + + echo "Old tag: $current_tag" echo "New tag: $new_tag" echo "new_tag=$new_tag" >> $GITHUB_OUTPUT echo "from_tag=$current_tag" >> $GITHUB_OUTPUT From 64aa6b357ee88a22dd1349fe953dd88bee51f1c6 Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 16:56:51 +0530 Subject: [PATCH 07/12] experiment --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60afa27..c77cb44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,10 +58,12 @@ jobs: run: | # Get the most recent tag in the format relayer-v current_tag=$(git tag --list "relayer-v*" --sort=-v:refname | head -n 1) + exp=$(git tag --list) new_tag="relayer-v${{ inputs.snowbridge_version }}-${{ inputs.runtime_version }}" echo "Old tag: $current_tag" echo "New tag: $new_tag" + echo "Exp: $exp" echo "new_tag=$new_tag" >> $GITHUB_OUTPUT echo "from_tag=$current_tag" >> $GITHUB_OUTPUT From d863e1e5efa925c9fc892c5cef46b43d6287755f Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Thu, 6 Feb 2025 18:05:17 +0530 Subject: [PATCH 08/12] add fetch-tags true and fetch-depth to 0 --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c77cb44..7a02e3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,9 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 submodules: 'true' + fetch-tags: 'true' - name: Set up Node.js uses: actions/setup-node@v2 @@ -58,12 +59,10 @@ jobs: run: | # Get the most recent tag in the format relayer-v current_tag=$(git tag --list "relayer-v*" --sort=-v:refname | head -n 1) - exp=$(git tag --list) new_tag="relayer-v${{ inputs.snowbridge_version }}-${{ inputs.runtime_version }}" echo "Old tag: $current_tag" echo "New tag: $new_tag" - echo "Exp: $exp" echo "new_tag=$new_tag" >> $GITHUB_OUTPUT echo "from_tag=$current_tag" >> $GITHUB_OUTPUT From e55860b19109d76844e03882bbcb2420ac1d72ce Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Fri, 7 Feb 2025 11:46:22 +0530 Subject: [PATCH 09/12] remove critera for PRs --- .github/workflows/release.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a02e3f..d0ebbc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,13 +84,7 @@ jobs: with: configurationJson: | { - "template": "#{{CHANGELOG}}\n\n
\n
", - "categories": [ - { - "title": "## Relayer Changes", - "labels": ["Component: Relayer"] - } - ] + "template": "#{{CHANGELOG}}\n\n
\n
" } fromTag: ${{ steps.new_version.outputs.from_tag }} toTag: ${{ steps.create_tag.outputs.tag }} From 0851c694a2881ab99de36c6f8ce1163453184e5f Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Fri, 7 Feb 2025 11:59:44 +0530 Subject: [PATCH 10/12] add template changes --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0ebbc2..620fcbf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,13 @@ jobs: with: configurationJson: | { - "template": "#{{CHANGELOG}}\n\n
\n
" + "template": "#{{CHANGELOG}}\n\n
\n
", + "categories": [ + { + "title": "## Relayer Changes", + "labels": [] + } + ] } fromTag: ${{ steps.new_version.outputs.from_tag }} toTag: ${{ steps.create_tag.outputs.tag }} From de32384694b80d5dd0387e19a4244aa8a75fecb1 Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Fri, 7 Feb 2025 12:02:08 +0530 Subject: [PATCH 11/12] add template changes + make the release draft --- .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 620fcbf..a436ab0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,7 +105,7 @@ jobs: release_name: ${{ steps.create_tag.outputs.tag }} body: | ${{steps.build_changelog.outputs.changelog}} - draft: false + draft: true prerelease: false - name: Upload Release Asset From d378023be75b5ed379a474109f45426f1c3354ad Mon Sep 17 00:00:00 2001 From: Parth Desai Date: Fri, 7 Feb 2025 17:01:33 +0530 Subject: [PATCH 12/12] remove un-necessary details --- .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 a436ab0..47d074c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: with: configurationJson: | { - "template": "#{{CHANGELOG}}\n\n
\n
", + "template": "#{{CHANGELOG}}", "categories": [ { "title": "## Relayer Changes",