Skip to content

Commit

Permalink
dbp-557- auto tag generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sahassou committed Feb 15, 2024
1 parent 4138adb commit cf8c24f
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions .github/workflows/auto-tag-release.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
name: Versioning
name: Update Semver Tags

on:
push:
branches:
- dbp-557-implement-semV # main
branches: # TODO: musst be tag
- dbp-557-implement-semV

jobs:
version:
update-semver-tags:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Get current version
run: |
git fetch --tags
version=$(git describe --tags --always)
if [[ "$version" =~ ^[0-9]+$ ]];
echo "VERSION=$version" >> $GITHUB_ENV
else
echo "VERSION=1" >> $GITHUB_ENV
fi
- name: Determine version type
run: |
version=${{ env.VERSION }}
new_version=$(($version + 1))
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
- name: Create new tag
if: ${{ github.ref == 'refs/heads/dbp-557-implement-semV' }} # main
uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1
with:
node-version: ${{ env.NODE_VERSION }}

- name: Update Semver
uses: rickstaa/action-update-semver@77e8cb0f3cd805b38ffe25c07236336e05dcb4da
with:
tag: ${{ env.NEW_VERSION }}
message: 'New version ${{ env.NEW_VERSION }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
major_version_tag_only: true # nur Major-Tags aktualisieren möchten.
move_patch_tag: true # Aktiviert die Verschiebung des Patch-Tags zum neuesten Commit.

0 comments on commit cf8c24f

Please sign in to comment.