From 4c524dfdc593af1544b0f0c372e9c6421ee31ca4 Mon Sep 17 00:00:00 2001 From: ilyesAj Date: Wed, 14 Dec 2022 08:28:08 +0100 Subject: [PATCH] add goreleaser files --- .github/workflows/release.yml | 15 ++++++++------ .goreleaser.yaml | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab3bb62..d92bc37 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,11 +15,14 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: "go.mod" - - name: Make all - run: make all VERSION=${GITHUB_REF##*/} - - name: Upload release binaries - uses: alexellis/upload-assets@0.3.0 + - name: install dependencies + run: go mod download + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: v1.11.5 + args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - asset_paths: '["./bin/*"]' diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..2b24a9e --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,37 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - windows + - linux + - darwin + goarch: + - amd64 + - arm + - arm64 + - '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj