feat: support darwin arm builds and golang 1.16 (#140)

* chore: bump to golang 1.16

* fix(ci): remove fail fast from non-matrix builds

* chore: rename release workflow from yml to yaml

* fix: use goreleaser for compile tests

* fix(make): use gorelease in compile target

* fix(ci): add gpg import step for compile
This commit is contained in:
Manuel Vogel 2021-03-18 15:21:49 +01:00 committed by GitHub
parent 97c491737c
commit 1159e2de73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 51 deletions

View file

@ -13,7 +13,7 @@ on:
- '.github/workflows/**'
env:
GO_VERSION: "1.15"
GO_VERSION: "1.16"
GOPROXY: https://gocenter.io,https://proxy.golang.org,direct
DEBIAN_FRONTEND: noninteractive
@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: '1.16'
- run: cat /etc/issue
- run: bash scripts/gogetcookie.sh
# locally: docker run -it ubuntu-20.04 bash (https://ubuntu.pkgs.org/20.04/docker-ce-stable-amd64/)

View file

@ -13,20 +13,28 @@ on:
- '.github/workflows/**'
env:
GO_VERSION: "1.15"
GO_VERSION: "1.16"
GOPROXY: https://gocenter.io,https://proxy.golang.org,direct
jobs:
compile:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
- run: cat /etc/issue
- run: bash scripts/gogetcookie.sh
- run: make compile
go-version: '1.16'
- name: Import GPG key
id: import_gpg
uses: paultyng/ghaction-import-gpg@v2.1.0
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --skip-publish --snapshot
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

View file

@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
- name: Import GPG key
id: import_gpg
uses: paultyng/ghaction-import-gpg@v2.1.0

View file

@ -13,19 +13,17 @@ on:
- '.github/workflows/**'
env:
GO_VERSION: "1.15"
GO_VERSION: "1.16"
GOPROXY: https://gocenter.io,https://proxy.golang.org,direct
jobs:
unit-test:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: '1.16'
- run: cat /etc/issue
- run: bash scripts/gogetcookie.sh
- run: make vet

View file

@ -12,19 +12,17 @@ on:
- website/docs/**
env:
GO_VERSION: "1.15"
GO_VERSION: "1.16"
GOPROXY: https://gocenter.io,https://proxy.golang.org,direct
jobs:
website-lint-spellcheck-tffmt:
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: '1.16'
- run: cat /etc/issue
- run: bash scripts/gogetcookie.sh
# locally: docker run -it ubuntu-20.04 bash (https://ubuntu.pkgs.org/20.04/docker-ce-stable-amd64/)

View file

@ -1 +1 @@
1.15.2
1.16.2

View file

@ -34,7 +34,7 @@ testacc_cleanup: fmtcheck
@sh -c "'$(CURDIR)/scripts/testacc_cleanup.sh'"
compile: fmtcheck
@sh -c "'$(CURDIR)/scripts/compile.sh'"
@sh -c "curl -sL https://git.io/goreleaser | bash -s -- --rm-dist --skip-publish --snapshot"
vet:
@echo "go vet ."

2
go.mod
View file

@ -18,4 +18,4 @@ require (
gotest.tools/v3 v3.0.3 // indirect
)
go 1.15
go 1.16

View file

@ -1,30 +0,0 @@
#!/bin/bash
set -e
# Prerequisites
if ! command -v gox > /dev/null; then
GO111MODULE=off go get -u github.com/mitchellh/gox
fi
# setup environment
PROVIDER_NAME="docker"
TARGET_DIR="$(pwd)/results"
XC_ARCH=${XC_ARCH:-"386 amd64 arm"}
XC_OS=${XC_OS:=linux darwin windows openbsd solaris}
XC_EXCLUDE_OSARCH="!darwin/arm !darwin/386 !solaris/amd64"
LD_FLAGS="-s -w"
export CGO_ENABLED=0
rm -rf "${TARGET_DIR}"
mkdir -p "${TARGET_DIR}"
# Compile
gox \
-os="${XC_OS}" \
-arch="${XC_ARCH}" \
-osarch="${XC_EXCLUDE_OSARCH}" \
-ldflags "${LD_FLAGS}" \
-output "$TARGET_DIR/{{.OS}}_{{.Arch}}/terraform-provider-${PROVIDER_NAME}_v0.0.0_x4" \
-verbose \
-rebuild \
.