Create a tag using Calendar Versioning, e.g. v2021.1.0
.
If set, tag the version as prerelease - set to e.g. alpha or beta
Required Default "v"
.
Only outputs the new version and don't actually tag the commit
The new version
Create a file named .github/workflows/deploy.yml
in your repo and add the following:
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: wendbv/[email protected]
You can also pass in a prerelease and disable the prefix, this will generate a version like 2021.1.0-beta.0
.
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: wendbv/[email protected]
with:
prerelease: beta
prefix: ''
You can add output-only
to only output the new version and don't actually tag the commit.
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: wendbv/calver-tag-action@v2
id: tag-version
with:
output-only: true
- name: Get the output version
run: echo "The new version is was ${{ steps.tag-version.outputs.version }}"