From 8c1de15ddf343e3f51dd6349e62c6ba480d0230b Mon Sep 17 00:00:00 2001 From: ws Date: Tue, 20 Jun 2023 10:43:21 +0800 Subject: [PATCH] chore(workflow): Add workflow --- .github/workflows/goreleaser.yml | 31 ++++++++++++++++++++++ .goreleaser.yml | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..865c24a --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,31 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +permissions: + contents: write + +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@v4 + with: + version: latest + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..8e4ecfc --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,44 @@ +before: + hooks: + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + main: . + ldflags: -s -w + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - '386' + - arm + - arm64 + - riscv + - riscv64 + - mips64 + +archives: + - format: zip + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} +release: + github: + owner: wsshow + name: envchecker +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: '{{ .Tag }}-next' +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'