add: goreleaser

This commit is contained in:
nite07 2024-03-12 02:24:23 +08:00
parent 54d6eb0f75
commit 8c115a82ff
3 changed files with 49 additions and 1 deletions

28
.github/workflows/goreleaser.yaml vendored Normal file

@ -0,0 +1,28 @@
name: build
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.5
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --rm-dist --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored

@ -1,4 +1,5 @@
.vscode/launch.json
.vscode/settings.json
dist
*test.go
template.json
template.json

19
.goreleaser.yaml Normal file

@ -0,0 +1,19 @@
project_name: sub2sing-box
builds:
- env:
- CGO_ENABLED=0
goos:
- windows
- linux
- darwin
goarch:
- amd64
- arm64
- arm
- "386"
ldflags:
- -s -w
no_unique_dist_dir: true
binary: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
archives:
- format: binary