Skip to content

Commit 2f27414

Browse files
Mihai BojinMihaiBojin
authored andcommitted
nochangelog: [0.6.3 - re-release] Add goreleaser config for packaging and signing binaries (#275)
1 parent 047c87e commit 2f27414

File tree

983 files changed

+100
-177561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

983 files changed

+100
-177561
lines changed

.github/workflows/release.yml

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

.goreleaser.yml

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

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require (
66
github.com/Sectorbob/mlab-ns2 v0.0.0-20171030222938-d3aa0c295a8a
77
github.com/client9/misspell v0.3.4
88
github.com/go-test/deep v1.0.3
9-
github.com/golangci/golangci-lint v1.26.0
109
github.com/hashicorp/terraform-plugin-sdk v1.14.0
1110
github.com/mwielbut/pointy v1.1.0
1211
github.com/spf13/cast v1.3.1

go.sum

Lines changed: 0 additions & 80 deletions
Large diffs are not rendered by default.

mongodbatlas/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (c *Config) NewClient() interface{} {
2727

2828
// Initialize the MongoDB Atlas API Client.
2929
atlasClient := matlasClient.NewClient(client)
30-
atlasClient.UserAgent = "terraform-provider-mongodbatlas"
30+
atlasClient.UserAgent = "terraform-provider-mongodbatlas/" + ProviderVersion
3131

3232
return atlasClient
3333
}

mongodbatlas/version.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package mongodbatlas
2+
3+
var (
4+
// ProviderVersion is set during the release process to the release version of the binary
5+
ProviderVersion = "dev"
6+
)

vendor/github.com/Djarvur/go-err113/.gitignore

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

vendor/github.com/Djarvur/go-err113/.golangci.yml

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

vendor/github.com/Djarvur/go-err113/.travis.yml

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

vendor/github.com/Djarvur/go-err113/LICENSE

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

0 commit comments

Comments
 (0)