From d7f91c8cca7378a98fab983f898565841a96e6d4 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:31:56 +0200 Subject: [PATCH 01/15] Go --- .github/workflows/create-version-tag.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/create-version-tag.yaml diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml new file mode 100644 index 000000000..6678dc8f2 --- /dev/null +++ b/.github/workflows/create-version-tag.yaml @@ -0,0 +1,16 @@ +on: + push: + branches: + # - main + +name: Create version tag + +jobs: + tag_main_commit: + name: Check for tag-triggering commit to `main` + runs-on: ubuntu-latest + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + + steps: + - run: echo ${{ github.head_commit.message }} From 1503f1db587aa5c8ba39cfb2a4d7390736327a69 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:34:12 +0200 Subject: [PATCH 02/15] go --- .github/workflows/create-version-tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 6678dc8f2..26a550c86 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -13,4 +13,4 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: - - run: echo ${{ github.head_commit.message }} + - run: echo ${{ github.event.pull_request.title }} From b415011942ac891db0485b4d6ef2a262e1dc352b Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:35:26 +0200 Subject: [PATCH 03/15] Maybe --- .github/workflows/create-version-tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 26a550c86..094ada65b 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -13,4 +13,4 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: - - run: echo ${{ github.event.pull_request.title }} + - run: echo ${{ github.event.head_commit.message }} From 2cf066e6521f7b177ad351f392d61036b3bf0647 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:52:28 +0200 Subject: [PATCH 04/15] Let's try it --- .github/workflows/create-version-tag.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 094ada65b..21d3071af 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -13,4 +13,13 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: - - run: echo ${{ github.event.head_commit.message }} + - name: Is this a commit we need to tag? + id: tag_check + run: | + echo "is_tagged_commit=" >> $GITHUB_OUTPUT + echo "${{ github.event.head_commit.message }}" \ + | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" \ + | wc -l >> $GITHUB_OUTPUT + + - name: Debug + run: echo ${{ steps.tag_check.outputs.is_tagged_commit }} From 226995ed3a44bcf267090305ec346e9073db7dd4 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:55:25 +0200 Subject: [PATCH 05/15] Maybe? --- .github/workflows/create-version-tag.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 21d3071af..100168c88 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -16,10 +16,9 @@ jobs: - name: Is this a commit we need to tag? id: tag_check run: | - echo "is_tagged_commit=" >> $GITHUB_OUTPUT - echo "${{ github.event.head_commit.message }}" \ - | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" \ - | wc -l >> $GITHUB_OUTPUT + is_tagged_commit="${{ github.event.head_commit.message }}" \ + | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" | wc -l + echo "is_tagged_commit=$is_tagged_commit" >> $GITHUB_OUTPUT - name: Debug run: echo ${{ steps.tag_check.outputs.is_tagged_commit }} From 0b071e2739142f06436830a4b72f74515994fc3a Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:58:30 +0200 Subject: [PATCH 06/15] Still not a tagged commit --- .github/workflows/create-version-tag.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 100168c88..058108bdb 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -21,4 +21,6 @@ jobs: echo "is_tagged_commit=$is_tagged_commit" >> $GITHUB_OUTPUT - name: Debug - run: echo ${{ steps.tag_check.outputs.is_tagged_commit }} + env: + IS_TAGGED_COMMIT: ${{ steps.tag_check.outputs.is_tagged_commit }} + run: echo "TAGGED? $IS_TAGGED_COMMIT" From 41bfa822232f99eec2d52c866fdfa950fcc83c71 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 15:58:59 +0200 Subject: [PATCH 07/15] =?UTF-8?q?=F0=9F=9A=80=20Bump=20version=20to=203.4.?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-version-tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 058108bdb..410d21adc 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -20,7 +20,7 @@ jobs: | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" | wc -l echo "is_tagged_commit=$is_tagged_commit" >> $GITHUB_OUTPUT - - name: Debug + - name: Debug again env: IS_TAGGED_COMMIT: ${{ steps.tag_check.outputs.is_tagged_commit }} run: echo "TAGGED? $IS_TAGGED_COMMIT" From 930e189f1bac7836cf1fdccab53c11f7d3d58dee Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:03:04 +0200 Subject: [PATCH 08/15] Have we done it --- .github/workflows/create-version-tag.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 410d21adc..08c63f101 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -16,9 +16,11 @@ jobs: - name: Is this a commit we need to tag? id: tag_check run: | - is_tagged_commit="${{ github.event.head_commit.message }}" \ - | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" | wc -l - echo "is_tagged_commit=$is_tagged_commit" >> $GITHUB_OUTPUT + is_tagged_commit=$( \ + echo "${{ github.event.head_commit.message }}" \ + | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" | wc -l \ + ) + echo "is_tagged_commit=$(($is_tagged_commit))" >> $GITHUB_OUTPUT - name: Debug again env: From d2b780eaa7afd75145228d4f5a761f26d664b00f Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:04:02 +0200 Subject: [PATCH 09/15] =?UTF-8?q?=F0=9F=9A=80=20Bump=20version=20to=202.4.?= =?UTF-8?q?6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-version-tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 08c63f101..ce2085e26 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -22,7 +22,7 @@ jobs: ) echo "is_tagged_commit=$(($is_tagged_commit))" >> $GITHUB_OUTPUT - - name: Debug again + - name: Debug env: IS_TAGGED_COMMIT: ${{ steps.tag_check.outputs.is_tagged_commit }} run: echo "TAGGED? $IS_TAGGED_COMMIT" From 7acdc7303e2f4208008397d433b48fc343040702 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:10:58 +0200 Subject: [PATCH 10/15] =?UTF-8?q?=F0=9F=9A=80=20Bump=20version=20to=202.4.?= =?UTF-8?q?8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-version-tag.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index ce2085e26..816439453 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -13,12 +13,15 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: + - name: Install Ripgrep + run: cargo install ripgrep + - name: Is this a commit we need to tag? id: tag_check run: | is_tagged_commit=$( \ echo "${{ github.event.head_commit.message }}" \ - | grep "^🚀 Bump version to \d\+\.\d\+\.\d\+" | wc -l \ + | rg "^🚀 Bump version to \d+\.\d+\.\d+" | wc -l \ ) echo "is_tagged_commit=$(($is_tagged_commit))" >> $GITHUB_OUTPUT From 42dacddef024957382cb65b15c7bb8d376a8aa7e Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:16:50 +0200 Subject: [PATCH 11/15] This is not a tagged commit --- .github/workflows/create-version-tag.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 816439453..8425f10d6 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -25,7 +25,15 @@ jobs: ) echo "is_tagged_commit=$(($is_tagged_commit))" >> $GITHUB_OUTPUT - - name: Debug - env: - IS_TAGGED_COMMIT: ${{ steps.tag_check.outputs.is_tagged_commit }} - run: echo "TAGGED? $IS_TAGGED_COMMIT" + - name: Create the tag + if: steps.tag_check.outputs.is_tagged_commit == 1 + id: get-version + run: | + new_version=$( \ + echo "${{ github.event.head_commit.message }}" \ + | cut -d " " -f 5" \ + ) + echo "tag_version=v${new_version}" >> $GITHUB_OUTPUT + + - run: echo "${{ steps.get-version.tag_version }}" + if: steps.tag_check.outputs.is_tagged_commit == 1 From 94e744c83c0e43460126fddc664e566ae66adbae Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:18:08 +0200 Subject: [PATCH 12/15] =?UTF-8?q?=F0=9F=9A=80=20Bump=20version=20to=207.8.?= =?UTF-8?q?9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-version-tag.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 8425f10d6..edcd56585 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -13,6 +13,11 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: + - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build" # share the cache across jobs + save-if: false + - name: Install Ripgrep run: cargo install ripgrep From 979beceb20a14282c90d01c16445cda251c1734d Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:20:25 +0200 Subject: [PATCH 13/15] Quote --- .github/workflows/create-version-tag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index edcd56585..9276b5af8 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -36,7 +36,7 @@ jobs: run: | new_version=$( \ echo "${{ github.event.head_commit.message }}" \ - | cut -d " " -f 5" \ + | cut -d " " -f 5 \ ) echo "tag_version=v${new_version}" >> $GITHUB_OUTPUT From 44b1876c5151c103aae668ffa058c9c43de356f4 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:20:45 +0200 Subject: [PATCH 14/15] =?UTF-8?q?=F0=9F=9A=80=20Bump=20version=20to=207.8.?= =?UTF-8?q?9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 11abd44db2d53159bf219904f6706dbdd9730456 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 26 Aug 2024 16:24:01 +0200 Subject: [PATCH 15/15] =?UTF-8?q?=F0=9F=9A=80=20Bump=20version=20to=202.4.?= =?UTF-8?q?6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-version-tag.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-version-tag.yaml b/.github/workflows/create-version-tag.yaml index 9276b5af8..43568cd36 100644 --- a/.github/workflows/create-version-tag.yaml +++ b/.github/workflows/create-version-tag.yaml @@ -13,13 +13,8 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: - - uses: Swatinem/rust-cache@v2 - with: - shared-key: "build" # share the cache across jobs - save-if: false - - name: Install Ripgrep - run: cargo install ripgrep + run: sudo apt-get install ripgrep - name: Is this a commit we need to tag? id: tag_check @@ -38,7 +33,9 @@ jobs: echo "${{ github.event.head_commit.message }}" \ | cut -d " " -f 5 \ ) - echo "tag_version=v${new_version}" >> $GITHUB_OUTPUT + echo "tag_version=v$new_version" >> $GITHUB_OUTPUT + echo $new_version + echo $GITHUB_OUTPUT - run: echo "${{ steps.get-version.tag_version }}" if: steps.tag_check.outputs.is_tagged_commit == 1