Skip to content

Commit 3a0912e

Browse files
committed
Setup release using goreleaser
1 parent 704e619 commit 3a0912e

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ jobs:
2222
uses: actions/setup-go@v3
2323
with:
2424
go-version-file: "go.mod"
25+
cache: true
2526
- name: Run tests
2627
run: make test
2728
- name: Run build
2829
run: make build
30+
- name: Upload Artifact
31+
uses: actions/upload-artifact@master
32+
with:
33+
name: tflint-ruleset-module-verification-${{ matrix.os }}
34+
path: tflint-ruleset-module-verification

.github/workflows/release.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,25 @@ name: release
33
on:
44
push:
55
branches:
6-
- '!*'
6+
- "!*"
77
tags:
8-
- v*.*.*
8+
- v*.*.*
99

1010
jobs:
1111
goreleaser:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v3
16-
- name: Set up Go
17-
uses: actions/setup-go@v3
18-
with:
19-
go-version-file: 'go.mod'
20-
- name: Import GPG key
21-
id: import_gpg
22-
uses: crazy-max/ghaction-import-gpg@v5
23-
with:
24-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
25-
passphrase: ${{ secrets.PASSPHRASE }}
26-
- name: Run GoReleaser
27-
uses: goreleaser/goreleaser-action@v3
28-
with:
29-
version: latest
30-
args: release --rm-dist
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version-file: "go.mod"
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v3
22+
with:
23+
version: latest
24+
args: release --rm-dist
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.goreleaser.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,20 @@ archives:
1818
format: zip
1919
files:
2020
- none*
21+
changelog:
22+
skip: true
2123
checksum:
22-
name_template: 'checksums.txt'
24+
name_template: "checksums.txt"
2325
signs:
24-
- artifacts: checksum
25-
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
26+
- cmd: cosign
27+
env:
28+
- COSIGN_EXPERIMENTAL=1
29+
signature: "${artifact}.keyless.sig"
30+
certificate: "${artifact}.pem"
31+
output: true
32+
artifacts: checksum
33+
args:
34+
- sign-blob
35+
- "--output-certificate=${certificate}"
36+
- "--output-signature=${signature}"
37+
- "${artifact}"

0 commit comments

Comments
 (0)