From eb43fc846c819625a53693a77b26d170fd5fc78d Mon Sep 17 00:00:00 2001 From: Lakshay Kalbhor Date: Tue, 16 Jan 2024 17:28:01 +0530 Subject: [PATCH] chore: add goreleaser --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .goreleaser.yml | 17 ++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a9e9d5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: goreleaser + +on: + push: + tags: + - "v*" # Will trigger only if tag is pushed matching pattern `v*` (Eg: `v0.1.0`) + +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: + go-version: "1.21" + + - 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 index 10620f7..02cceb2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,22 +1,25 @@ -env: - - CGO_ENABLED=1 - before: hooks: - - make dist - + - go mod tidy + builds: - - binary: kaf-relay.bin - main: . + - env: + - CGO_ENABLED=1 + binary: kaf-relay goos: - windows + - darwin - linux + - freebsd + - openbsd - netbsd goarch: - amd64 archives: - format: tar.gz + rlcp: true files: + - config.toml.sample - README.md - LICENSE \ No newline at end of file