Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/provider: Initial goreleaser configuration and CI workflow #14033

Merged
merged 4 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/terraform_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- .github/workflows/terraform_provider.yml
- .golangci.yml
- .goreleaser.yml
- aws/**
- awsproviderlint/**
- docs/index.md
Expand Down Expand Up @@ -225,6 +226,30 @@ jobs:
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint
- run: golangci-lint run ./aws/...

goreleaser:
needs: [go_mod_download]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- name: goreleaser check
continue-on-error: true
uses: goreleaser/goreleaser-action@v2
with:
args: check
radeksimko marked this conversation as resolved.
Show resolved Hide resolved
- name: goreleaser build
uses: goreleaser/goreleaser-action@v2
with:
args: build --snapshot --timeout 1h

tfproviderdocs:
needs: [terraform_providers_schema]
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ example.tf
terraform.tfplan
terraform.tfstate
bin/
dist/
modules-dev/
/pkg/
website/.vagrant
Expand Down
44 changes: 44 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
archives:
- files:
- none*
format: zip
radeksimko marked this conversation as resolved.
Show resolved Hide resolved
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
before:
hooks:
- go mod download
builds:
- binary: '{{ .ProjectName }}_{{ .Version }}'
goarch:
- '386'
- amd64
- arm
- arm64
goos:
- darwin
- freebsd
- linux
- windows
ignore:
- goarch: '386'
goos: darwin
ldflags:
- -s -w -X github.com/terraform-providers/terraform-provider-aws/aws/version.ProviderVersion={{.Version}}
paultyng marked this conversation as resolved.
Show resolved Hide resolved
changelog:
skip: true
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
env:
- CGO_ENABLED=0
release:
disable: true
signs:
- artifacts: checksum
args:
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
7 changes: 2 additions & 5 deletions docs/MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@ Create an issue to cover the update noting down any areas of particular interest
Ensure that the following steps are tracked within the issue and completed within the resulting pull request.

- Update go version in `go.mod`
- Verify all formatting, linting, and testing works as expected
- Verify `gox` builds for all currently supported architectures:
```
gox -os='linux darwin windows freebsd openbsd solaris' -arch='386 amd64 arm' -osarch='!darwin/arm !darwin/386' -ldflags '-s -w -X aws/version.ProviderVersion=99.99.99 -X aws/version.ProtocolVersion=4' -output 'results/{{.OS}}_{{.Arch}}/terraform-provider-aws_v99.99.99_x4' .
```
- Verify `make test lint` works as expected
- Verify `goreleaser build --snapshot` succeeds for all currently supported architectures
- Verify `goenv` support for the new version
- Update `docs/DEVELOPMENT.md`
- Update `.github/workflows/*.yml`
Expand Down