From 48e745bd1931400e30d6935afecd5c5c0f3a0dfc Mon Sep 17 00:00:00 2001 From: xhe Date: Tue, 23 May 2023 13:19:29 +0800 Subject: [PATCH] *: add goreleaser (#285) --- .github/workflows/release.yaml | 31 +++++++++++++++++++++++++++++++ .gitignore | 1 + .goreleaser.yaml | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..118225da --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,31 @@ +name: goreleaser + +on: + push: + tag: + - v* + +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 + # More assembly might be required: Docker logins, GPG, etc. It all depends + # on your needs. + - uses: goreleaser/goreleaser-action@v4 + with: + # either 'goreleaser' (default) or 'goreleaser-pro': + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 40870748..c6c53611 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ work .vscode/ .cover* grafonnet-lib +dist diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..cbbeeb89 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,33 @@ +builds: + - + id: "tiproxy" + main: ./cmd/tiproxy + binary: tiproxy + ldflags: + - -s -w -X main.Version={{.Version}} -X main.commit={{.FullCommit}} + goos: + - linux + goarch: + - amd64 + - arm64 + goarm: + - 7 + goamd64: + - v2 + - v3 + - + id: "tiproxyctl" + main: ./cmd/tiproxyctl + binary: tiproxyctl + ldflags: + - -s -w -X main.Version={{.Version}} -X main.commit={{.FullCommit}} + goos: + - linux + goarch: + - amd64 + - arm64 + goarm: + - 7 + goamd64: + - v2 + - v3