From a54e2859e9798448d4f5b75a7ebe81c1e7b73211 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 8 Jun 2023 18:28:37 +0200 Subject: [PATCH] ci(gorelease): setup gorelease for github actions --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ .gorelease.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .gorelease.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c9b0a06 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: goreleaser + +on: + push: + tags: + - 1.* + - 0.* + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Fetch all tags + run: git fetch --force --tags + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.19 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gorelease.yaml b/.gorelease.yaml new file mode 100644 index 0000000..2952fbd --- /dev/null +++ b/.gorelease.yaml @@ -0,0 +1,32 @@ +before: + hooks: + - go mod tidy + # you may remove this if you don't need go generate + #- go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - -H windowsgui +archives: + - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs' + - '^test' \ No newline at end of file