Skip to content

Commit

Permalink
Updated workflow to release floating tags
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-aravind committed Nov 6, 2024
1 parent 84cf9bf commit a43d4f1
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Docker Image to GHCR
name: Release new version

on:
release:
Expand Down Expand Up @@ -37,3 +37,26 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

create-floating-tag:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set major version
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
current_version=${{github.event.release.tag_name}}
if [[ ! "$current_version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: current_version does not follow semantic versioning (vX.Y.Z)."
exit 1
fi
major_version="${version%%.*}"
git tag -d "$major_version" 2>/dev/null || echo "Tag $major_version not found."
git tag $major_version $current_version
git push origin $major_version --force

0 comments on commit a43d4f1

Please sign in to comment.