Skip to content

Commit

Permalink
generate releases on tags as part of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yannh committed Jun 22, 2020
1 parent 24cdafa commit f7bfd2c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: build

name: ci
on: push

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -18,3 +15,16 @@ jobs:

- name: acceptance-test
run: make docker-acceptance

goreleaser:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: checkout
uses: actions/checkout@v2

- name: goreleaser
run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
builds:
- env:
- CGO_ENABLED=0
- GOFLAGS = -mod=vendor
- GO111MODULE = on
goos:
- windows
- linux
- darwin
flags:
- -trimpath
- -tags=netgo
- -a
ldflags:
- -extldflags "-static"
archives:
- format: tar.gz
format_overrides:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ docker-acceptance: build-bats
docker run -t bats acceptance.bats

release:
goreleaser --rm-dist
docker run -e GITHUB_TOKEN -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform goreleaser/goreleaser:v0.138 goreleaser release --rm-dist

0 comments on commit f7bfd2c

Please sign in to comment.