Skip to content

Commit 8f2f6b7

Browse files
committed
chore: update workflow and goreleaser
1 parent 7838a17 commit 8f2f6b7

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
name: CI
33

44
on:
5-
pull_request_target:
6-
branches:
7-
- 'main'
8-
- 'release/**'
5+
pull_request:
6+
7+
permissions:
8+
contents: write
99

1010
jobs:
1111
fmt:
@@ -44,6 +44,10 @@ jobs:
4444
with:
4545
fetch-depth: 0
4646

47+
- name: Set BUILDVERSION env var
48+
id: buildversion
49+
run: echo "BUILDVERSION=$(git describe --tags --always)" >> $GITHUB_ENV
50+
4751
- name: Setup Go env
4852
uses: actions/setup-go@v5
4953
with:
@@ -60,8 +64,8 @@ jobs:
6064
uses: goreleaser/goreleaser-action@v6
6165
with:
6266
version: "~> v2"
63-
args: release --clean --skip=publish
67+
args: release --clean --skip=publish --snapshot
6468
env:
6569
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6670
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
67-
71+
BUILDVERSION: ${{ env.BUILDVERSION }}

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
tags:
1919
- "v*"
2020

21+
permissions:
22+
contents: write
23+
2124
jobs:
2225
goreleaser:
2326
runs-on: ubuntu-latest

.goreleaser.yml renamed to .goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ builds:
2828
goarch: '386'
2929
binary: '{{ .ProjectName }}_v{{ .Version }}'
3030
archives:
31-
- format: zip
31+
- formats: ["zip"]
3232
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
3333
checksum:
3434
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'

0 commit comments

Comments
 (0)