From 94b61f2c7f405ed95d77c816d2c9258e1cad9fba Mon Sep 17 00:00:00 2001 From: ross96D Date: Fri, 23 Aug 2024 10:40:03 -0400 Subject: [PATCH] add go releaser --- .github/workflows/release.yml | 35 +++++++++++++++++++++++ .goreleaser | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bc28111 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: goreleaser + +on: + push: + # run only against tags + tags: + - "*" + +permissions: + contents: write + +jobs: + goreleaser: + name: Create release-artifacts + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser b/.goreleaser new file mode 100644 index 0000000..3bbe732 --- /dev/null +++ b/.goreleaser @@ -0,0 +1,52 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + # - go generate ./... + +git: + tag_sort: -version:creatordate + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + # - darwin + + ldflags: + - -s -w -X main.Date={{.CommitDate}} + + goarch: + - amd64 + + # ensure a reproducible build. + mod_timestamp: "{{ .CommitTimestamp }}" + +archives: + - format: binary + +release: + mode: append + github: + owner: ross96D + name: updater + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"