From 04bad29578affdb428d3379ff1786800fa1c41ad Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:57:09 +0400 Subject: [PATCH 1/6] Use release tag name --- .github/workflows/abi.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index 99e30c3068..8e5d9b2970 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -35,11 +35,7 @@ jobs: - name: Update version from tag working-directory: ./contracts/dist run: | - VERSION="0.1.0" - if [ "${{ env.GITHUB_REF_TYPE }}" = "tag" ]; then - VERSION="${GITHUB_REF_NAME#v}" - fi - + VERSION="${${{ github.event.release.tag_name }}#v}" echo "Version set to $VERSION" sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json From 04a4d24a52d49994f915e821b5ac83dc3b2614fd Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:08:14 +0400 Subject: [PATCH 2/6] Tweak job --- .github/workflows/abi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index 8e5d9b2970..8482600e08 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -35,7 +35,8 @@ jobs: - name: Update version from tag working-directory: ./contracts/dist run: | - VERSION="${${{ github.event.release.tag_name }}#v}" + VERSION="${${{ github.event.push.ref }}#refs/tags/v}" + echo "Debugging ${{ github.event.push.ref }}" echo "Version set to $VERSION" sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json From f0d85ce2feb920ccc90f44caf27179a38f7ce033 Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:16:17 +0400 Subject: [PATCH 3/6] Try different expression --- .github/workflows/abi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index 8482600e08..28759e70cb 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -35,7 +35,7 @@ jobs: - name: Update version from tag working-directory: ./contracts/dist run: | - VERSION="${${{ github.event.push.ref }}#refs/tags/v}" + VERSION="${${{ github.event.push.ref }}##*/v}" echo "Debugging ${{ github.event.push.ref }}" echo "Version set to $VERSION" sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json From dbd1ec7459a01d0862cb0a02a928656acf7b445f Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:22:09 +0400 Subject: [PATCH 4/6] Use github.ref --- .github/workflows/abi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index 28759e70cb..efa1cf5285 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -35,8 +35,8 @@ jobs: - name: Update version from tag working-directory: ./contracts/dist run: | - VERSION="${${{ github.event.push.ref }}##*/v}" - echo "Debugging ${{ github.event.push.ref }}" + VERSION="${${{ github.ref }}##*/v}" + echo "Debugging ${{ github.ref }}, $GITHUB_REF_NAME, $GITHUB_REF" echo "Version set to $VERSION" sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json From b6c4895edadbd946ab6fc748fbc5ed9170f30fb7 Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:26:01 +0400 Subject: [PATCH 5/6] Tweak it more --- .github/workflows/abi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index efa1cf5285..a37e505d18 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -35,8 +35,8 @@ jobs: - name: Update version from tag working-directory: ./contracts/dist run: | - VERSION="${${{ github.ref }}##*/v}" - echo "Debugging ${{ github.ref }}, $GITHUB_REF_NAME, $GITHUB_REF" + VERSION=${GITHUB_REF_NAME#v} + echo "Debugging GITHUB_REF_NAME, $VERSION" echo "Version set to $VERSION" sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json From 14b659050884b824101cd104c38b83e5733e2bc7 Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:29:23 +0400 Subject: [PATCH 6/6] Remove echo --- .github/workflows/abi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/abi.yml b/.github/workflows/abi.yml index a37e505d18..a82a56a427 100644 --- a/.github/workflows/abi.yml +++ b/.github/workflows/abi.yml @@ -36,7 +36,6 @@ jobs: working-directory: ./contracts/dist run: | VERSION=${GITHUB_REF_NAME#v} - echo "Debugging GITHUB_REF_NAME, $VERSION" echo "Version set to $VERSION" sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json