@@ -20,10 +20,26 @@ jobs:
|
||||
- name: Configure version information
|
||||
id: calculate-version
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
uses: bitshifted/git-auto-semver@v2
|
||||
with:
|
||||
create_tag: true
|
||||
initial_version: 0.2.0
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch --tags --unshallow || true
|
||||
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.2.0")
|
||||
|
||||
IFS='.' read -r major minor patch <<< "${LAST_TAG#v}"
|
||||
NEW_VERSION="$major.$minor.$((patch + 1))"
|
||||
NEW_TAG="v$NEW_VERSION"
|
||||
|
||||
CHANGELOG=$(git log ${LAST_TAG}..HEAD --oneline | sed 's/^/* /')
|
||||
[ -z "$CHANGELOG" ] && CHANGELOG="Maintenance build."
|
||||
|
||||
git tag $NEW_TAG
|
||||
git push origin $NEW_TAG
|
||||
|
||||
echo "version-string=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "## What's Changed" >> $GITHUB_OUTPUT
|
||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup Tools Cache
|
||||
id: tools-cache
|
||||
@@ -102,3 +118,4 @@ jobs:
|
||||
files: unlocker.zip
|
||||
tag_name: v${{ steps.calculate-version.outputs.version-string }}
|
||||
name: Release v${{ steps.calculate-version.outputs.version-string }}
|
||||
body: ${{ steps.calculate-version.outputs.changelog }}
|
||||
|
||||
Reference in New Issue
Block a user