Skip to content

Commit

Permalink
automate release process using goreleaser and github actions
Browse files Browse the repository at this point in the history
- Adds goreleaser config yaml
- Ignore goreleaser's `dist` directory which is used as the build / distribution directory
- Adds GitHub Action workflow config yaml for automatic release using goreleaser on push of git tag

Fixes #37

Signed-off-by: Karuppiah Natarajan <karuppiahn@vmware.com>
  • Loading branch information
karuppiah7890 committed Aug 25, 2021
1 parent b1a9c48 commit 981b0d1
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: goreleaser

on:
push:
tags:
- "*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
depstat
.DS_Store
bin
bin
dist/
34 changes: 34 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
ldflags:
- -X github.com/kubernetes-sigs/depstat/cmd.DepstatVersion={{.Version}}

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 981b0d1

Please sign in to comment.