From 8c115a82ff51ea389ab8a5940b6189b48818aca3 Mon Sep 17 00:00:00 2001 From: nite07 Date: Tue, 12 Mar 2024 02:24:23 +0800 Subject: [PATCH] add: goreleaser --- .github/workflows/goreleaser.yaml | 28 ++++++++++++++++++++++++++++ .gitignore | 3 ++- .goreleaser.yaml | 19 +++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/goreleaser.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml new file mode 100644 index 0000000..a779e9f --- /dev/null +++ b/.github/workflows/goreleaser.yaml @@ -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 }} diff --git a/.gitignore b/.gitignore index 68d6a21..16db01c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode/launch.json +.vscode/settings.json dist *test.go -template.json \ No newline at end of file +template.json diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..f5af655 --- /dev/null +++ b/.goreleaser.yaml @@ -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 \ No newline at end of file