From 42abf0adf7fcd17cc0785920754a227c3a9491b5 Mon Sep 17 00:00:00 2001 From: Liam Perritt Date: Mon, 14 Jul 2025 10:08:10 +1000 Subject: [PATCH 1/4] Create GitHub release when tagging --- .github/workflows/tag.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 9fdd4e68..85ff5036 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -33,10 +33,11 @@ jobs: continue fi - echo "Tagging $commit as v${version}" - git tag "v${version}" $commit + echo "Creating tag and release for $commit as v${version}" + gh release create "v${version}" \ + --title "Release CLI v${version}" \ + --generate-notes \ + --target $commit done - - - name: Push new tags - shell: bash - run: git push --tags + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c54e466ae3a272e041c2babe60c8384f2ab05ec4 Mon Sep 17 00:00:00 2001 From: Liam Perritt Date: Mon, 14 Jul 2025 10:19:38 +1000 Subject: [PATCH 2/4] Create tag before releasing --- .github/workflows/tag.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 85ff5036..42115666 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -26,18 +26,22 @@ jobs: run: | set -e - commits=$(git log --pretty=format:"%h" ./VERSION) + commits=$(git log --pretty=format:"%H" ./VERSION) for commit in $commits; do version=$(git show $commit:./VERSION) if [ -n "$(git tag -l "v${version}")" ]; then continue fi - echo "Creating tag and release for $commit as v${version}" + echo "Tagging $commit as v${version}" + git tag "v${version}" $commit + git push origin "v${version}" + + echo "Creating release for v${version}" gh release create "v${version}" \ --title "Release CLI v${version}" \ --generate-notes \ - --target $commit + --target "${commit}" done env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c9e7f5830d0181454a47b3e4706bd15fd28fa2c6 Mon Sep 17 00:00:00 2001 From: Liam Perritt Date: Mon, 14 Jul 2025 10:26:21 +1000 Subject: [PATCH 3/4] Improve release title --- .github/workflows/tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 42115666..34c645c4 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -39,7 +39,7 @@ jobs: echo "Creating release for v${version}" gh release create "v${version}" \ - --title "Release CLI v${version}" \ + --title "v${version}" \ --generate-notes \ --target "${commit}" done From b5d4033269ccdac675a6d83def77466cbfb9f5e5 Mon Sep 17 00:00:00 2001 From: Liam Perritt Date: Mon, 14 Jul 2025 11:00:29 +1000 Subject: [PATCH 4/4] Specify tag in push --- .github/workflows/tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 34c645c4..cc5c65a9 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -35,7 +35,7 @@ jobs: echo "Tagging $commit as v${version}" git tag "v${version}" $commit - git push origin "v${version}" + git push origin tag "v${version}" echo "Creating release for v${version}" gh release create "v${version}" \