Skip to content

Commit

Permalink
chore: add goreleaser workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sundowndev committed Nov 17, 2022
1 parent a67d064 commit 49abd36
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: release

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.0.0

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v3.2.0
with:
go-version: 1.17.8

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3.0.0
with:
version: v1.12.3
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project_name: covermyass
dist: bin
release:
github:
owner: sundowndev
name: covermyass
draft: false
prerelease: auto
before:
hooks:
- go generate ./...
builds:
- id: "covermyass"
binary: covermyass
dir: .
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
#- windows
goarch:
- amd64
- arm
- arm64
- 386
ldflags: "-s -w -X github.com/sundowndev/covermyass/build.version={{.Version}} -X github.com/sundowndev/covermyass/pkg/version.commit={{.ShortCommit}}"
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
format: binary
replacements:
armv6: arm
checksum:
name_template: '{{ .ProjectName }}_SHA256SUMS'
algorithm: sha256
snapshot:
name_template: "{{ .Tag }}-next"

0 comments on commit 49abd36

Please sign in to comment.