Skip to content

Commit

Permalink
Improve goreleaser setup
Browse files Browse the repository at this point in the history
  • Loading branch information
geertw committed Sep 6, 2023
1 parent 02efb2b commit a8fa22e
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Release

on:
pull_request:
workflow_dispatch:
push:
tags:
- '*'
workflow_dispatch:

permissions:
# goreleaser writes to the releases api
contents: write

jobs:

Expand All @@ -13,23 +18,30 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.15
uses: actions/setup-go@v2
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "flags=--snapshot" >> $GITHUB_ENV

- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: ^1.15
go-version: ^1.21
id: go

- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 50

fetch-depth: 0

- run: git fetch --force --tags

-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean ${{ env.flags }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a8fa22e

Please sign in to comment.