Skip to content

Commit

Permalink
Merge pull request #9 from signalsciences/SignOnRelease
Browse files Browse the repository at this point in the history
Sign and release on github actions
  • Loading branch information
jhanrahan-sigsci authored Sep 17, 2020
2 parents f4556b3 + e9c936f commit 0bf9ef7
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 12 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
-
name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
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_TTY: $(tty)
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
60 changes: 60 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
project_name: terraform-provider-sigsci
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- 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 }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
cmd: gpg
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:
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
github:
owner: github-actions-sigsci
name: signalsciences/terraform-provider-sigsci
name_template: "{{.ProjectName}}-v{{.Version}}"
changelog:
skip: true
12 changes: 0 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,6 @@ github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DK
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/signalsciences/go-sigsci v0.1.0 h1:9OpelrOf5XinHR+Cc27DGO4JIeduo/hpDWyYjaNgEGQ=
github.com/signalsciences/go-sigsci v0.1.0/go.mod h1:pUmTMqvzuYtcP3TrYt63mpKmZeZown9yl+9xgB8xwbI=
github.com/signalsciences/go-sigsci v0.1.1-0.20200629165842-1c1bdb1422d5 h1:XqelekS3xiB13OzL1tZsyPESAu0G7DcKNyWP4dP6XuE=
github.com/signalsciences/go-sigsci v0.1.1-0.20200629165842-1c1bdb1422d5/go.mod h1:fxwZliaeAnt/s6mERHLh71f5sW5lEL0ZDN7R5JAByXE=
github.com/signalsciences/go-sigsci v0.1.1-0.20200629233807-b47d46cd000c h1:dyO/bc7/eqKoaUprT7N/ZNsmbJd4QUyGXAn4zmqtK9A=
github.com/signalsciences/go-sigsci v0.1.1-0.20200629233807-b47d46cd000c/go.mod h1:fxwZliaeAnt/s6mERHLh71f5sW5lEL0ZDN7R5JAByXE=
github.com/signalsciences/go-sigsci v0.1.1-0.20200825203324-ed1b25337f64 h1:zTwdC4PKKUAB9JuPyUHSql5o7AhcccDFYtJVNVcMwys=
github.com/signalsciences/go-sigsci v0.1.1-0.20200825203324-ed1b25337f64/go.mod h1:fxwZliaeAnt/s6mERHLh71f5sW5lEL0ZDN7R5JAByXE=
github.com/signalsciences/go-sigsci v0.1.1-0.20200825224232-34da19bdff00 h1:qcpfmU1TwLFC2QM7feQ5Z4ibLLhJNTblt5mSDNKR4d0=
github.com/signalsciences/go-sigsci v0.1.1-0.20200825224232-34da19bdff00/go.mod h1:fxwZliaeAnt/s6mERHLh71f5sW5lEL0ZDN7R5JAByXE=
github.com/signalsciences/go-sigsci v0.1.1-0.20200903184819-63c0635edb12 h1:NzHe73gXJE14EA9kZ+Mgv58/x5VInCkw7GSua1n3C5k=
github.com/signalsciences/go-sigsci v0.1.1-0.20200903184819-63c0635edb12/go.mod h1:fxwZliaeAnt/s6mERHLh71f5sW5lEL0ZDN7R5JAByXE=
github.com/signalsciences/go-sigsci v0.1.1-0.20200908173133-5e947c11afc3 h1:z/j8qG4eW0k26CkDmQEf/8o2pGdRVqOa0a6pQVF87+c=
github.com/signalsciences/go-sigsci v0.1.1-0.20200908173133-5e947c11afc3/go.mod h1:QzNMfETjwm4NFuFS4K1UoLO4wWdopUv3AFyvO092Fak=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
Expand Down

0 comments on commit 0bf9ef7

Please sign in to comment.