@@ -20,10 +20,26 @@ jobs:
|
|||||||
- name: Configure version information
|
- name: Configure version information
|
||||||
id: calculate-version
|
id: calculate-version
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
uses: bitshifted/git-auto-semver@v2
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
create_tag: true
|
git fetch --tags --unshallow || true
|
||||||
initial_version: 0.2.0
|
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
|
- name: Setup Tools Cache
|
||||||
id: tools-cache
|
id: tools-cache
|
||||||
@@ -102,3 +118,4 @@ jobs:
|
|||||||
files: unlocker.zip
|
files: unlocker.zip
|
||||||
tag_name: v${{ steps.calculate-version.outputs.version-string }}
|
tag_name: v${{ steps.calculate-version.outputs.version-string }}
|
||||||
name: Release 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