Skip to content
Merged
Show file tree
Hide file tree
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
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
pull_request:
branches: [main]
paths:
- .github/workflows/release.yml
- .goreleaser.yaml
push:
tags: ['v*.*.*']

jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- uses: goreleaser/goreleaser-action@v6
if: github.event_name == 'pull_request'
with:
version: '~> v2'
args: release --snapshot
env:
GITHUB_TOKEN: ${{ github.token }}
# Disable the monorepo feature
GORELEASER_CURRENT_TAG: v0.0.1
GORELEASER_PREVIOUS_TAG: v0.0.1-alpha

- uses: goreleaser/goreleaser-action@v6
if: github.event_name != 'pull_request'
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ github.token }}
49 changes: 49 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2

before:
hooks:
- make tidy
- make bin/mk_funcs.so

builds:
- id: devctl
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64

archives:
- formats: [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
formats: [zip]

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
draft: false
prerelease: auto
extra_files:
- glob: ./bin/mk_funcs.so
name_template: mk_funcs.so