File tree Expand file tree Collapse file tree 2 files changed +93
-0
lines changed
Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Original file line number Diff line number Diff line change 1+ # This GitHub action can publish assets for release when a tag is created.
2+ # Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
3+ #
4+ # This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
5+ # private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
6+ # secret. If you would rather own your own GPG handling, please fork this action
7+ # or use an alternative one for key handling.
8+ #
9+ # You will need to pass the `--batch` flag to `gpg` in your signing step
10+ # in `goreleaser` to indicate this is being used in a non-interactive mode.
11+ #
12+ name : release
13+ on :
14+ push :
15+ tags :
16+ - " v*"
17+ jobs :
18+ goreleaser :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v2
23+ - name : Unshallow
24+ run : git fetch --prune --unshallow
25+ - name : Set up Go
26+ uses : actions/setup-go@v2
27+ with :
28+ go-version : 1.16
29+ - name : Import GPG key
30+ id : import_gpg
31+ uses : hashicorp/ghaction-import-gpg@v2.1.0
32+ env :
33+ # These secrets will need to be configured for the repository:
34+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
35+ PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
36+ - name : Run GoReleaser
37+ uses : goreleaser/goreleaser-action@v2
38+ with :
39+ version : latest
40+ workdir : provider
41+ args : release --rm-dist
42+ env :
43+ GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
44+ # GitHub sets this automatically
45+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ builds :
2+ - env :
3+ # goreleaser does not work with CGO, it could also complicate
4+ # usage by users in CI/CD systems like Terraform Cloud where
5+ # they are unable to install libraries.
6+ - CGO_ENABLED=0
7+ mod_timestamp : ' {{ .CommitTimestamp }}'
8+ flags :
9+ - -trimpath
10+ ldflags :
11+ - ' -s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
12+ goos :
13+ - freebsd
14+ - windows
15+ - linux
16+ - darwin
17+ goarch :
18+ - amd64
19+ - ' 386'
20+ - arm
21+ - arm64
22+ ignore :
23+ - goos : darwin
24+ goarch : ' 386'
25+ binary : ' {{ .ProjectName }}_v{{ .Version }}'
26+ archives :
27+ - format : zip
28+ name_template : ' {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
29+ checksum :
30+ name_template : ' {{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
31+ algorithm : sha256
32+ signs :
33+ - artifacts : checksum
34+ args :
35+ # if you are using this in a GitHub action or some other automated pipeline, you
36+ # need to pass the batch flag to indicate its not interactive.
37+ - " --batch"
38+ - " --local-user"
39+ - " {{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
40+ - " --output"
41+ - " ${signature}"
42+ - " --detach-sign"
43+ - " ${artifact}"
44+ release :
45+ # If you want to manually examine the release before its live, uncomment this line:
46+ # draft: true
47+ changelog :
48+ skip : true
You can’t perform that action at this time.
0 commit comments