Skip to content

aserto-dev/sver-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sver-action

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

Example

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 }}:{}'

Inputs

pre_release

Optional If specified, this pre release reference will be added to the calculated semantic version.

docker_image

Optional If specified, sver will calculate the tags for your docker image.

docker_registry

Optional Registry for the docker image.

docker_username

Optional Credentials for connecting to the docker registry.

docker_password

Optional Credentials for connecting to the docker registry.

next

Optional Tells sver to print the next version, not the current one. Can be one of patch, minor or major.

Outputs

version

The calculated version. When using this to calculate tags, the output is a multiline string, with each tag on a separate line.