Skip to content

Commit 8e5646a

Browse files
committed
Add binary releases
1 parent a5e9dc1 commit 8e5646a

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
jobs:
8+
goreleaser:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Checkout
13+
uses: actions/checkout@v2.3.1
14+
-
15+
name: Unshallow
16+
run: git fetch --prune --unshallow
17+
-
18+
name: Set up Go
19+
uses: actions/setup-go@v2.1.0
20+
with:
21+
go-version: '1.15'
22+
# -
23+
# name: Import GPG key
24+
# id: import_gpg
25+
# uses: paultyng/ghaction-import-gpg@v2.1.0
26+
# env:
27+
# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
28+
# PASSPHRASE: ${{ secrets.PASSPHRASE }}
29+
-
30+
name: Run GoReleaser
31+
uses: goreleaser/goreleaser-action@v2
32+
with:
33+
version: latest
34+
args: release --rm-dist
35+
env:
36+
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
project_name: tfstaticregistry
2+
builds:
3+
- main: ./cmd/tfstaticregistry
4+
env:
5+
- CGO_ENABLED=0
6+
mod_timestamp: '{{ .CommitTimestamp }}'
7+
flags:
8+
- -trimpath
9+
ldflags:
10+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
11+
binary: '{{ .ProjectName }}'
12+
archives:
13+
- format: zip
14+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
15+
checksum:
16+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
17+
algorithm: sha256
18+
# signs:
19+
# - artifacts: checksum
20+
# args:
21+
# # if you are using this is a GitHub action or some other automated pipeline, you
22+
# # need to pass the batch flag to indicate its not interactive.
23+
# - "--batch"
24+
# - "--local-user"
25+
# - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
26+
# - "--output"
27+
# - "${signature}"
28+
# - "--detach-sign"
29+
# - "${artifact}"
30+
release:
31+
changelog:
32+
skip: true

0 commit comments

Comments
 (0)