From fd1de0f9bcd19c6fbea41e2a73d27e108171bbef Mon Sep 17 00:00:00 2001 From: gouravkrosx Date: Mon, 22 Apr 2024 19:05:17 +0530 Subject: [PATCH] ci: add release workflow Signed-off-by: gouravkrosx --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .goreleaser.yaml | 17 +++++++++++++++++ 2 files changed, 48 insertions(+) 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..52b05d5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release +on: + push: + tags: + - "v*.*.*" + +permissions: + contents: write + +jobs: + build-go: + runs-on: self-hosted + # needs: build-ui + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.22 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + VERSION: ${{ github.ref }} + 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..48392d5 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,17 @@ +# GoReleaser configuration +archives: + - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + format: binary + +builds: + - binary: pilot + id: pilot + main: ./main.go + env: + - CGO_ENABLED=0 + goos: + - linux + # - windows + goarch: + - amd64 + - arm64 \ No newline at end of file