Skip to content

Commit

Permalink
Introduce GoReleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
yaegashi committed Feb 15, 2020
1 parent 2603848 commit 54491b3
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/go.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
push:
tags:
- '*'
jobs:
go_releaser:
name: GoReleaser
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test
on:
push:
branches:
- '*'
jobs:
go_test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test
run: go test -v ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ token_cache.json
*.tfstate*
*.log
terraform-provider-msgraph
terraform-provider-msgraph_v*
/dist
18 changes: 18 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
before:
hooks:
- go mod tidy
- go test -v ./...
builds:
- goos: [linux, darwin, windows]
goarch: [amd64]
binary: 'terraform-provider-msgraph{{if eq (printf "%.8s" .Version) "snapshot"}}_v{{.Version}}{{end}}'
archives:
- name_template: '{{.ProjectName}}_{{if ne (printf "%.8s" .Version) "snapshot"}}v{{end}}{{.Version}}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "snapshot-{{.ShortCommit}}"
changelog:

0 comments on commit 54491b3

Please sign in to comment.