-
Notifications
You must be signed in to change notification settings - Fork 40
43 lines (41 loc) · 1.33 KB
/
tag_version.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 v${{ env.new_tag }} -m "Tagging the ${{ env.new_tag }} ${{ github.event.inputs.releaseType }} release"
- name: Push Changes
run: git push --follow-tags