Skip to content

Commit

Permalink
Add release process
Browse files Browse the repository at this point in the history
  • Loading branch information
paultyng committed Jul 14, 2020
1 parent 3e91088 commit 1ba002f
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 28 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: goreleaser

on:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2.3.1
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2.1.0
with:
go-version: 1.14
# -
# 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
env:
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
project_name: tfpluginwebsite
builds:
- main: ./cmd/tfpluginwebsite
env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
# signs:
# - artifacts: checksum
# args:
# # if you are using this is a GitHub action or some other automated pipeline, you
# # need to pass the batch flag to indicate its not interactive.
# - "--batch"
# - "--local-user"
# - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
# - "--output"
# - "${signature}"
# - "--detach-sign"
# - "${artifact}"
release:
draft: true
changelog:
skip: true
16 changes: 0 additions & 16 deletions Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions cmd/tfpluginwebsite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ import (
func main() {
name := "tfpluginwebsite"
version := name + " Version " + version
if builtBy != "" {
version += ", built by " + builtBy
}
if commit != "" {
version += " from commit " + commit
}
if date != "" {
version += " on " + date
}

os.Exit(cmd.Run(
name,
Expand Down
2 changes: 0 additions & 2 deletions cmd/tfpluginwebsite/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ var (
// These vars will be set by goreleaser.
version string = `dev`
commit string = ``
date string = ``
builtBy string = ``
)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-plugin-docs
go 1.14

require (
github.com/hashicorp/terraform-exec v0.2.1
github.com/hashicorp/terraform-exec v0.2.3-0.20200714005955-7764650a3a04
github.com/hashicorp/terraform-json v0.5.0
github.com/mattn/go-colorable v0.1.7
github.com/mitchellh/cli v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/terraform-exec v0.2.1 h1:ryZW7JnytAeB+kZXhj2WPYvGYRfcp7Zs9vxmAAgedeA=
github.com/hashicorp/terraform-exec v0.2.1/go.mod h1:yKWvMPtkTaHpeAmllw+1qdHZ7E5u+pAZ+x8e2jQF6gM=
github.com/hashicorp/terraform-exec v0.2.3-0.20200714005955-7764650a3a04 h1:bXcto+c9xqlWf2Ci/J8cJVVZdWqGpUc9jwD5ylqH40E=
github.com/hashicorp/terraform-exec v0.2.3-0.20200714005955-7764650a3a04/go.mod h1:yKWvMPtkTaHpeAmllw+1qdHZ7E5u+pAZ+x8e2jQF6gM=
github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f0wvREtyzs=
github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE=
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ provider %[1]q {
return nil, err
}

tfBin, err := tfinstall.Find(tfinstall.LookPath(), tfinstall.ExactVersion("0.13.0-beta3", tmpDir))
tfBin, err := tfinstall.Find(tfinstall.ExactVersion("0.13.0-beta3", tmpDir))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1ba002f

Please sign in to comment.