Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
.github/workflows: try to bypass snapshot mode of GoReleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoshinNikita committed Feb 3, 2021
1 parent e7a7b36 commit 12df8de
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,27 @@ jobs:
with:
fetch-depth: 0

# GoReleaser forces snapshot mode if a tag is dirty. So, tag the last commit to bypass this behavior
# https://github.com/goreleaser/goreleaser-action/blob/master/src/main.ts#L34
- name: Bypass GoReleaser check
if: ${{ contains(github.ref, 'refs/heads/') }}
run: git tag v0.0.0-bypass-snapshot-mode

- name: Update GoReleaser config
if: ${{ contains(github.ref, 'refs/tags/') }}
run: echo "GORELEASER_CONFIG=.goreleaser.yml" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Update GoReleaser config
if: ${{ contains(github.ref, 'refs/tags/') }}
run: echo "GORELEASER_CONFIG=.goreleaser.yml" >> $GITHUB_ENV

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
version: v0.155.0
args: release --rm-dist --config=${{ env.GORELEASER_CONFIG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 12df8de

Please sign in to comment.