Skip to content

Commit

Permalink
build: use goreleaser to publish a release
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeaning777 committed Sep 22, 2020
1 parent 672b484 commit 23cade7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: goreleaser

on:
pull_request:
push:

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.15
-
name: Run GoReleaser (DryRun)
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: --snapshot --rm-dist --skip-publish
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
30 changes: 30 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm
- arm64
main: ./cmd/exec-with-secret
archives:
- replacements:
linux: Linux
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 23cade7

Please sign in to comment.