Semantic versioning action.
Can output:
- The current version of your repo, as calculated by sver.
- The next patch/minor/major version
- The tags you should apply to your docker container image
jobs:
build:
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: https://ghcr.io
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- uses: aserto-dev/sver@v0
name: Calculate Tags
id: "sver"
with:
docker_image: ${{ env.DOCKER_IMAGE }}
docker_registry: "https://ghcr.io"
docker_registry_username: ${{ env.DOCKER_USERNAME }}
docker_registry_password: ${{ env.DOCKER_PASSWORD }}
- name: Push image to GitHub Container Registry
run: |
echo "${{ steps.sver.outputs.version }}" | \
xargs -I{} bash -c "docker tag my-image ghcr.io:{}' \
&& docker push '${{ env.DOCKER_IMAGE }}:{}'
Optional If specified, this pre release reference will be added to the calculated semantic version.
Optional If specified, sver will calculate the tags for your docker image.
Optional Registry for the docker image.
Optional Credentials for connecting to the docker registry.
Optional Credentials for connecting to the docker registry.
Optional Tells sver to print the next version, not the current one. Can be one of patch
, minor
or major
.
The calculated version. When using this to calculate tags, the output is a multiline string, with each tag on a separate line.