Skip to content

Commit

Permalink
add goreleaser deploy workflow (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Schreiber authored Dec 11, 2020
1 parent 1374b0b commit 10fa06e
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 168 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: deploy

on:
push:
tags:
- v*.*.*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod download
builds:
- dir: go
main: v1beta1/main/main.go
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
- image_templates:
- "liatrio/grafeas-elasticsearch:latest"
- "liatrio/grafeas-elasticsearch:{{ .Tag }}"
- "liatrio/grafeas-elasticsearch:v{{ .Major }}"
- "liatrio/grafeas-elasticsearch:v{{ .Major }}.{{ .Minor }}"
extra_files:
- "go.mod"
- "go.sum"
- "go"
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ require (
github.com/pelletier/go-toml v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0 // indirect
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.6.1 // indirect
go.uber.org/zap v1.10.0
golang.org/x/sys v0.0.0-20201118182958-a01c418693c7 // indirect
google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98
google.golang.org/grpc v1.33.1
google.golang.org/grpc/examples v0.0.0-20201209011439-fd32f6a4fefe // indirect
google.golang.org/protobuf v1.25.0
)

Expand Down
Loading

0 comments on commit 10fa06e

Please sign in to comment.