Skip to content

Tag Version

Tag Version #42

Workflow file for this run

name: Tag Version
on:
workflow_dispatch:
inputs:
releaseType:
description: 'Semver Release Type (minor,patch)'
required: true
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ZORGBORT_TOKEN }}
- name: Validate releaseType
run: npx in-string-list ${{ github.event.inputs.releaseType }} minor,patch
- name: Get Current Tag
id: currentTag
run: |
CURRENT_TAG=$(git describe --tags --abbrev=0)
echo ${CURRENT_TAG}
echo "current_tag=${CURRENT_TAG}" >> $GITHUB_ENV
- name: Get New Tag
id: newTag
run: |
NEW_TAG=$(npx semver --increment ${{ github.event.inputs.releaseType }} ${{env.current_tag}})
echo ${NEW_TAG}
echo "new_tag=${NEW_TAG}" >> $GITHUB_ENV
- name: Setup Git
run: |
git config user.name Zorgbort
git config user.email info@iliosproject.org
- name: Increment version
run: |
composer config version ${{ env.new_tag }}
git commit -a -m "Bump Ilios version to ${{ env.new_tag }}"
- name: Tag Version
run: git tag ${{ env.new_tag }} -m "Tagging the ${{ env.new_tag }} ${{ github.event.inputs.releaseType }} release"
- name: Push Changes
run: git push --follow-tags