diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
@@ -1,29 +1,33 @@
name: Publish github release
on:
- create:
+ push:
tags: ["v*"]
+
+permissions:
+ contents: write
+
jobs:
generate-artifacts:
name: Generate cross-platform builds
runs-on: ubuntu-latest
steps:
- - name: Set up Go
- uses: actions/setup-go@v2
- with:
- go-version: 1.19
-
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
+ - name: Set up Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.19
+
- name: Run GoReleaser
- uses: goreleaser/goreleaser-action@v2
+ uses: goreleaser/goreleaser-action@v5
with:
+ distribution: goreleaser
version: latest
args: release --clean
- workdir: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
@@ -12,8 +12,6 @@ before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
- # you may remove this if you don't need go generate
- - go generate ./...
builds:
- env:
diff --git a/.goreleaser.yml b/.goreleaser.yml
@@ -1,30 +0,0 @@
-before:
- hooks:
- - go mod download
-builds:
-- <<: &build_defaults
- ldflags:
- - -s -w
- env:
- - CGO_ENABLED=0
- goos:
- - linux
- - darwin
- - windows
- goarch:
- - 386
- - amd64
- - arm
- - arm64
-archives:
- -
- replacements:
- darwin: Darwin
- linux: Linux
- windows: Windows
- 386: i386
- amd64: x86_64
- format_overrides:
- -
- goos: windows
- format: zip
| | |