diff --git a/.github/workflows/release_please.yml b/.github/workflows/release_please.yml index 297e9acd..b5366bed 100644 --- a/.github/workflows/release_please.yml +++ b/.github/workflows/release_please.yml @@ -20,3 +20,12 @@ jobs: with: release-type: go package-name: release-please-action + + - name: Upload Release Artifact + if: ${{ steps.release.outputs.release_created }} + uses: goreleaser/goreleaser-action@v6 + with: + version: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ steps.release.outputs.tag_name }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..00b88da7 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,43 @@ +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + + main: ./cmd/substation + binary: substation + +release: + mode: keep-existing # required for compatibility with release-please + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"