Skip to content

Commit

Permalink
Add goreleaser to build and release dlv binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Dufty committed Apr 28, 2022
1 parent 3841099 commit 02ea136
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: 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:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ localtests
*.iml
.teamcity/target
.vscode

dist/
31 changes: 31 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
-
main: ./cmd/dlv
binary: dlv
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
archives:
- id: github
format: binary
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 02ea136

Please sign in to comment.