Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
IceWreck committed Jan 31, 2023
1 parent 324435a commit f0f1a03
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]*"

name: Create release and upload binaries

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.17.0'
cache: true

- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ out
dump
bin
HookMsg
config.yaml
config.yaml
dist
17 changes: 17 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
project_name: hookmsg

build:
env:
- CGO_ENABLED=0

main: ./cmd/hookmsg
binary: hookmsg
goos:
- linux
goarch:
- amd64
- arm64

archives:
- name_template: "{{.Os}}-{{.Arch}}-{{ .ProjectName }}"
format: tar.gz

0 comments on commit f0f1a03

Please sign in to comment.