chore: update GitHub Actions workflow for automated versioning and release management

- Replace manual version detection with GitHub Tag Action
- Implement automatic version bumping and tagging
- Add GitHub Release creation with changelog generation
- Simplify Docker image tagging using new version workflow
This commit is contained in:
jango-blockchained
2025-02-04 15:00:40 +01:00
parent 5f078ff227
commit 63fd21053c

View File

@@ -23,21 +23,21 @@ jobs:
with:
fetch-depth: 0 # Required for version detection
- name: Get version from tag
id: version
uses: actions/github-script@v6
with:
script: |
const tag = process.env.GITHUB_REF?.replace('refs/tags/v', '');
return tag || 'latest';
- name: Set up semantic versioning
id: semver
uses: mathieudutour/github-tag-action@v6
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
tag_prefix: 'v'
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Log in to the Container registry
uses: docker/login-action@v2
@@ -52,8 +52,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ steps.version.outputs.result }}
type=raw,value=${{ steps.semver.outputs.new_tag }}
type=raw,value=${{ steps.tag_version.outputs.new_tag }}
type=raw,value=latest
- name: Build and push Docker image