Skip to content

Tag

Tag #25

Workflow file for this run

name: Tag
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version'
required: true
jobs:
tag:
name: Tag
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/hotfix/v')
steps:
- name: Checkout project
uses: actions/checkout@v5
with:
token: ${{ secrets.CI_CD_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Validate release version format
run: |
if [[ ! "${{ github.event.inputs.release_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Release version must follow SemVer format (X.Y.Z) and start with a digit"
echo "Current value: ${{ github.event.inputs.release_version }}"
echo "Expected format: 1.2.3, 2.0.0, etc."
echo "Note: The 'v' prefix will be added automatically to the tag. Do not include it manually"
exit 1
fi
- name: Create tag
run: |
git tag v${{ github.event.inputs.release_version }} -s -m "Create tag v${{ github.event.inputs.release_version }}"
git push origin v${{ github.event.inputs.release_version }}