Skip to content

feat: Add goreleaser configuration #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
on:
release:
types: [created]
push:
# run only against tags
tags:
- "*"

jobs:
releases-matrix:
releases:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64

steps:
- uses: actions/checkout@v4.2.2

- uses: wangyoucao577/go-release-action@v1.52
- name: Setup Go
uses: actions/setup-go@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.24.2
binary_name: task-runner-launcher
project_path: ./cmd/launcher
sha256sum: true
extra_files: README.md LICENSE.md LICENSE_EE.md
go-version: 'stable'

- name: Build Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75 changes: 75 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Documentation at https://goreleaser.com

# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- main: ./cmd/launcher/main.go
binary: task-runner-launcher
flags:
- -trimpath
ldflags:
- -w -s
env:
- CGO_ENABLED=0
goos:
- darwin
- freebsd
- linux
- netbsd
- openbsd
- windows
goarch:
- 386
- amd64
- arm
- arm64
- loong64
- mips64le
- ppc64le
- s390x
- riscv64
goarm:
- 6
- 7

archives:
- formats: [ 'tar.gz' ]
name_template: "{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: false
files:
- README.md
- LICENSE.md
- LICENSE_EE.md
format_overrides:
- goos: windows
formats: [ 'zip' ]

checksum:
name_template: "{{ .ArtifactName }}.{{ .Algorithm }}"
algorithm: sha256
split: true

snapshot:
version_template: "{{ incpatch .Version }}-next"

changelog:
use: github
sort: '' # use the output of `git log` as is
filters:
exclude:
- '^docs:'
- '^test:'
- '^tests:'
- '^chore:'
- '^Merge pull request'

release:
draft: true