Skip to content

Commit a493c07

Browse files
committed
add release workflow
1 parent 3593672 commit a493c07

File tree

5 files changed

+107
-33
lines changed

5 files changed

+107
-33
lines changed

.github/workflows/go.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Source: https://www.terraform.io/docs/registry/providers/publishing.html
2+
3+
# This GitHub action can publish assets for release when a tag is created.
4+
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
5+
#
6+
# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your
7+
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
8+
# secret. If you would rather own your own GPG handling, please fork this action
9+
# or use an alternative one for key handling.
10+
#
11+
# You will need to pass the `--batch` flag to `gpg` in your signing step
12+
# in `goreleaser` to indicate this is being used in a non-interactive mode.
13+
#
14+
name: release
15+
on:
16+
push:
17+
tags:
18+
- 'v*'
19+
jobs:
20+
goreleaser:
21+
runs-on: ubuntu-latest
22+
steps:
23+
-
24+
name: Checkout
25+
uses: actions/checkout@v2
26+
-
27+
name: Unshallow
28+
run: git fetch --prune --unshallow
29+
-
30+
name: Set up Go
31+
uses: actions/setup-go@v2
32+
with:
33+
go-version: 1.14
34+
-
35+
name: Import GPG key
36+
id: import_gpg
37+
uses: paultyng/ghaction-import-gpg@v2.1.0
38+
env:
39+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
40+
PASSPHRASE: ${{ secrets.PASSPHRASE }}
41+
-
42+
name: Run GoReleaser
43+
uses: goreleaser/goreleaser-action@v2
44+
with:
45+
version: latest
46+
args: release --rm-dist
47+
env:
48+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Source: https://www.terraform.io/docs/registry/providers/publishing.html
2+
3+
# Visit https://goreleaser.com for documentation on how to customize this
4+
# behavior.
5+
before:
6+
hooks:
7+
# this is just an example and not a requirement for provider building/publishing
8+
- go mod tidy
9+
builds:
10+
- env:
11+
# goreleaser does not work with CGO, it could also complicate
12+
# usage by users in CI/CD systems like Terraform Cloud where
13+
# they are unable to install libraries.
14+
- CGO_ENABLED=0
15+
mod_timestamp: '{{ .CommitTimestamp }}'
16+
flags:
17+
- -trimpath
18+
ldflags:
19+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
20+
goos:
21+
- freebsd
22+
- windows
23+
- linux
24+
- darwin
25+
goarch:
26+
- amd64
27+
- '386'
28+
- arm
29+
- arm64
30+
ignore:
31+
- goos: darwin
32+
goarch: '386'
33+
binary: '{{ .ProjectName }}_v{{ .Version }}'
34+
archives:
35+
- format: zip
36+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
37+
checksum:
38+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
39+
algorithm: sha256
40+
signs:
41+
- artifacts: checksum
42+
args:
43+
# if you are using this is a GitHub action or some other automated pipeline, you
44+
# need to pass the batch flag to indicate its not interactive.
45+
- "--batch"
46+
- "--local-user"
47+
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
48+
- "--output"
49+
- "${signature}"
50+
- "--detach-sign"
51+
- "${artifact}"
52+
release:
53+
# If you want to manually examine the release before its live, uncomment this line:
54+
# draft: true
55+
changelog:
56+
skip: true

chaossearch/resource_object_group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func resourceObjectGroupRead(ctx context.Context, data *schema.ResourceData, met
109109

110110
resp, err := c.ReadObjectGroup(ctx, req)
111111
if err != nil {
112-
return diag.Errorf("Failed to read object group: ", err)
112+
return diag.Errorf("Failed to read object group: %s", err)
113113
}
114114

115115
data.Set("name", data.Id())

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
415415
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
416416
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
417417
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
418+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
418419
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
419420
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
420421
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=

0 commit comments

Comments
 (0)