From 239196db6927614dc2d4471e7132e9b390c3b252 Mon Sep 17 00:00:00 2001 From: Sam McLeod Date: Sat, 1 Jun 2024 16:36:37 +1000 Subject: [PATCH] minor updates --- .github/workflows/build-and-release.yaml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index d19054c..0e78d83 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -58,21 +58,14 @@ jobs: release_branches: main pre_release_branches: dev - # Delete latest tag - - name: Delete latest tag - if: github.ref == 'refs/heads/main' + # Make a new latest tag and force push it + - name: Make a new latest tag and force push it + if: ${{ steps.tag_version.outputs.new_tag != 'false' }} run: | - git push origin :refs/tags/latest - - # Bump latest version - - name: Bump latest version - id: tag_latest - if: github.ref == 'refs/heads/main' - uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b # v6.2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - release_branches: main - custom_tag: latest + git fetch --tags + git checkout ${{ github.ref }} + git tag -f latest ${{ steps.tag_version.outputs.new_tag }} + git push origin latest --force # Publish - name: Create a GitHub release