From 6a67f712b56e23e156766d03ba9ad786a398c183 Mon Sep 17 00:00:00 2001 From: Leslie Leung Date: Sat, 4 Nov 2023 02:54:49 +0800 Subject: [PATCH] build: add CI/CD pipeline --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ .goreleaser.yaml | 26 ++++++++++++++++++++++++++ main.go | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dd5903d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: goreleaser + +on: + push: + tags: + - "*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v4 + with: + go-version: stable + - uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..562af67 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,26 @@ +project_name: reaper +before: + hooks: + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/main.go b/main.go index 441bfec..d376c96 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "reaper/cmd" + "github.com/leslieleung/reaper/cmd" ) func main() {