From ad339c0130cd83236f1a6f7845003434a3ac8ea3 Mon Sep 17 00:00:00 2001 From: mrekucci <4932785+mrekucci@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:14:05 +0100 Subject: [PATCH] chore: add goreleaser --- .github/workflows/goreleaser.yaml | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/goreleaser.yaml diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml new file mode 100644 index 0000000000..ed2a54bbd8 --- /dev/null +++ b/.github/workflows/goreleaser.yaml @@ -0,0 +1,35 @@ +name: goreleaser + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + packages: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} + run: echo "flags=--snapshot" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-go@v3 + with: + go-version: 1.21 + cache: true + - name: GHCR Docker Login + run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean ${{ env.flags }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}