Skip to content

Commit

Permalink
ci: add goreleaser workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nightah committed Jul 25, 2022
1 parent d5031ef commit 08d3362
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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: Fetch all tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
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
Expand Up @@ -5,6 +5,7 @@
*.so
*.dylib
lancache-diagnostics
dist/

# Test binary, built with `go test -c`
*.test
Expand Down
28 changes: 28 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
project_name: lancache-diagnostics
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
goarch:
- amd64
gcflags:
- -trimpath
ldflags:
- -s -w
archives:
- id: lancache-diagnostics
name_template: "{{ .ProjectName}}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format: tar.gz
snapshot:
name_template: "{{ .ProjectName}}-v{{ incpatch .Version }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 08d3362

Please sign in to comment.