1
0
mirror of https://github.com/darkzoul5/YoutubePlaylistSync.git synced 2026-07-03 20:43:59 +03:00

Add automatic version tagging to release workflow

This commit is contained in:
2025-10-13 00:24:12 +03:00
parent 36705e6d1d
commit f4d610fcce
+39
View File
@@ -2,10 +2,49 @@ name: Build Release Packages
on: on:
push: push:
branches:
- main
#tags: #tags:
#- "v*" #- "v*"
jobs: jobs:
determine-next-tag:
runs-on: ubuntu-latest
outputs:
next_tag: ${{ steps.set_tag.outputs.next_tag }}
steps:
- name: Checkout code
uses: https://gitea.com/actions/checkout@v5
- name: Determine next version tag
id: set_tag
run: |
git fetch --tags
LATEST_TAG=$(git tag -l "v*.*.*" | sort -V | tail -n1)
echo "Latest tag: $LATEST_TAG"
if [ -z "$LATEST_TAG" ]; then
NEXT_TAG="v0.0.1"
else
PATCH=$(echo $LATEST_TAG | awk -F. '{print $3}')
MAJOR=$(echo $LATEST_TAG | awk -F. '{print $1}' | tr -d 'v')
MINOR=$(echo $LATEST_TAG | awk -F. '{print $2}')
PATCH=$((PATCH+1))
NEXT_TAG="v${MAJOR}.${MINOR}.${PATCH}"
fi
echo "Next tag: $NEXT_TAG"
echo "next_tag=$NEXT_TAG" >> $GITHUB_OUTPUT
- name: Create new tag
run: |
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
git tag ${{ steps.set_tag.outputs.next_tag }}
git push origin ${{ steps.set_tag.outputs.next_tag }}
windows-package: windows-package:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps: