From 1430c928286dae55828531e18dcb8b66ee553a7e Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Sun, 16 Oct 2022 09:24:46 +0300 Subject: [PATCH] ci: add build release feature - linux amd64 pre-built bimaries on every v* tag push --- .github/workflows/release.yaml | 30 ++++++++++++++++++++++++++++++ .goreleaser.yaml | 15 +++++++++++++++ 2 files changed, 45 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 0000000..b5df129 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +name: goreleaser + +on: + push: + tags: + - "v*" + +jobs: + goreleaser: + runs-on: ubuntu-latest + environment: build + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.19 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: --parallelism 1 --rm-dist --skip-validate + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..9bc1f70 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,15 @@ +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + main: ./ + ldflags: + - -s -w + +archives: + - format: tar.gz + files: + - LICENSE