Skip to content

Commit

Permalink
feat: support goreleaser for release
Browse files Browse the repository at this point in the history
  • Loading branch information
kingfs committed May 15, 2023
1 parent 38bdd2e commit 2ae6121
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: release blasehttp cli

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Run tests
run: go test ./...

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean
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 @@ -22,3 +22,5 @@ go.work

/blazehttp
dist/
output*/
.builds/
56 changes: 56 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
project_name: blazehttp

dist: .builds

before:
hooks:
- go mod tidy

builds:
- id: build
main: ./cmd/blazehttp
binary: blazehttp
# ldflags:
# - -s -w -X github.com/chaitin/blazehttp/cmd/blazehttp.Version={{ .Version }}
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
- arm
goarm:
- 7
ignore:
- goos: windows
goarch: arm
- goos: darwin
goarch: arm

release:
draft: false

archives:
- id: archive
builds: [build]
format: zip
files:
- LICENSE*
- CHANGELOG*

checksum:
name_template: 'checksums.txt'

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

changelog:
sort: asc
filters:
exclude:
- '^examples:'
- '^debug:'
- '^doc:'

0 comments on commit 2ae6121

Please sign in to comment.