Skip to content

Release

Release #9

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
goreleaser:
if: true # false to skip job during debug
runs-on: ubuntu-latest
steps:
- name: Set up Golang
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Release via goreleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
if: true # false to skip job during debug
strategy:
fail-fast: true
matrix:
image: [
{file: 'Dockerfile', tag: ''},
{file: 'demo/Dockerfile', tag: '-demo'}
]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Version strings
id: version
run: |
echo "RELEASE_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish beta version to Registry
if: ${{ contains(github.ref_name, 'beta') }}
uses: elgohr/Publish-Docker-Github-Action@v5
env:
GIT_HASH: ${{ github.sha }}
VERSION: ${{ github.ref_name }}
GIT_TIME: ${{ steps.version.outputs.RELEASE_TIME }}
with:
name: cybertecpostgresql/pgwatch${{ matrix.image.tag }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/${{ matrix.image.file }}
buildargs: GIT_HASH,GIT_TIME
tags: ${{ github.ref_name }}
platforms: linux/amd64,linux/arm64
- name: Publish "latest" tag to Registry
if: ${{ !contains(github.ref_name, 'beta') && matrix.image.tag == '-demo' }}
uses: elgohr/Publish-Docker-Github-Action@v5
env:
GIT_HASH: ${{ github.sha }}
VERSION: ${{ github.ref_name }}
GIT_TIME: ${{ steps.version.outputs.RELEASE_TIME }}
with:
name: cybertecpostgresql/pgwatch${{ matrix.image.tag }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/${{ matrix.image.file }}
buildargs: GIT_HASH,GIT_TIME
tags: latest
platforms: linux/amd64,linux/arm64
- name: Publish "X.X.X, X.X, X" tags to Registry
if: ${{ !contains(github.ref_name, 'beta') && matrix.image.tag == '' }}
uses: elgohr/Publish-Docker-Github-Action@v5
env:
GIT_HASH: ${{ github.sha }}
VERSION: ${{ github.ref_name }}
GIT_TIME: ${{ steps.version.outputs.RELEASE_TIME }}
with:
name: cybertecpostgresql/pgwatch${{ matrix.image.tag }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/${{ matrix.image.file }}
buildargs: GIT_HASH,GIT_TIME
tag_semver: true
platforms: linux/amd64,linux/arm64