Skip to content

goreleaser

goreleaser #335

Workflow file for this run

name: goreleaser
on:
create:
tags:
jobs:
qovery:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Ensure tag match the current version
run: |
version=$(git tag | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
version_without_v=$(echo $version | sed -r 's/v(.+)/\1/')
file="cmd/version.go"
if [ "v$(grep '// ci-version-check' $file | sed -r 's/.+return\s"(.+)".+/\1/')" != "$version" ] ; then
echo "Tag version do not match application version in $file"
exit 1
fi
file="charts/pleco/Chart.yaml"
if [ "v$(grep 'appVersion' $file | awk '{ print $2 }')" != "$version" ] ; then
echo "Tag appVersion do not match application version in $file"
exit 1
fi
if [ "v$(grep 'version' $file | awk '{ print $2 }')" != "$version" ] ; then
echo "Tag version do not match application version in $file"
exit 1
fi
file="charts/pleco/values.yaml"
if [ "$(grep 'plecoImageTag' $file | awk -F'\"' '{ print $2 }')" != "$version_without_v" ] ; then
echo "Tag version do not match application version in $file"
exit 1
fi
-
name: Set up Go
uses: actions/setup-go@main
with:
go-version: 1.21
-
name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
args: "--timeout 5m0s"
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: "v1.26.2"
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
-
name: Get smart tag
id: prepare
uses: Surgo/docker-smart-tag-action@v1
with:
docker_image: qoveryrd/pleco
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: DockerHub login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Docker build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.prepare.outputs.tag }}
-
name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}