glitch-in-the-system/.github/workflows/version.yml

41 lines
1.2 KiB
YAML
Raw Normal View History

name: Version & Release
on:
push:
branches:
- develop
jobs:
CheckVersion:
runs-on: ubuntu-latest
container:
image: rightbrainnetworks/auto-semver
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run auto-semver
id: semver
run: |
export regex='^\\s*current_version\\s*=\\s*\\K[^\\s]+'
export RETURN_STATUS=`semver -n`
echo "Semver Return Status: ${RETURN_STATUS}"
export SEMVER_NEW_VERSION=`grep -Po '${regex}' .bumpversion.cfg`
export VERSION=`semver_get_version -d`
echo ::set-output name=RETURN_STATUS::$RETURN_STATUS
echo ::set-output name=SEMVER_NEW_VERSION::$SEMVER_NEW_VERSION
echo ::set-output name=VERSION::$VERSION
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: steps['semver']['outputs']['RETURN_STATUS'] == '0'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
release_name: v${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
body: |
Glitch In The System v${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
draft: false
prerelease: false