Github Action for RBN Auto Semver by Branch tool
Runs to either set or get the semantic version managed by auto-semver.
Accepted values: get
, set
Default: set
The exit code of semver. Returns 0 on new version.
See the exit codes section on auto-semver README.
The version pulled from the .bumpversion.cfg
file after being updated
The version outputed by semver.
In this example, auto-semver runs on master and creates a release on a new version:
name: Version & Release
on:
push:
branches:
- master
jobs:
CheckVersion:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run Auto-Semver
id: semver
uses: RightBrain-Networks/[email protected]
with:
mode: set
- name: Create Release
uses: actions/create-release@v1
if: steps['semver']['outputs']['RETURN_STATUS'] == '0'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
release_name: ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
body: Version ${{ steps.semver.outputs.SEMVER_NEW_VERSION }} released automatically by [RightBrain-Networks/auto-semver](https://github.com/RightBrain-Networks/auto-semver)
draft: false
prerelease: false
This mode grabs the version from the ref
and updates any files listed in .bumpversion.cfg
Therefore, to get the proper version the trigger should be a release or a push to tags.
The semantic version found in the ref
In this example, the version is updated from the ref
to build a python package.
name: Build Python Package
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Run Auto-Semver
id: semver
uses: RightBrain-Networks/[email protected]
with:
mode: set
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: build
run: |
python setup.py sdist bdist_wheel