Skip to content

Commit

Permalink
build: add CI files
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuheiKubota committed Dec 23, 2023
1 parent f007450 commit 3f467d3
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
project_name: hosted
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- binary: hosted
flags:
- -trimpath
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- linux
goarch:
- amd64
- 386
hooks:
post: upx --lzma '{{ .Path }}'
archives:
- name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format_overrides:
- goos: windows
format: zip
release:
prerelease: auto
changelog:
skip: false
filters:
exclude:
- '^test:'
groups:
- title: 'Features'
regexp: "^.*feat[(\\w)!]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)!]*:+.*$"
order: 1
- title: 'Others'
order: 999

0 comments on commit 3f467d3

Please sign in to comment.