Skip to content

Commit

Permalink
chore: Add GoReleaser and workflow for releasing
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung committed Sep 28, 2023
1 parent c43eb13 commit 2ca2584
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Fetch all tags
run: |
git config --global --add safe.directory /__w/kraftkit/kraftkit
git fetch --force --tags
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --rm-dist --skip-validate --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
69 changes: 69 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#! .goreleaser.yaml
changelog:
sort: asc
use: github
filters:
include:
- '^.*#[[:digit:]]+.*$'
groups:
- title: ⚠️ Breaking Changes
regexp: '^[[:xdigit:]]+: [[:lower:]]+(\(.*\))?!:.*$'
order: 1
- title: 🚀 New Features
regexp: '^[[:xdigit:]]+: feat(\(.*\))?:.*$'
order: 2
- title: 🐛 Bug Fixes
regexp: '^[[:xdigit:]]+: fix(\(.*\))?:.*$'
order: 3
- title: 📖 Docs
regexp: '^[[:xdigit:]]+: docs(\(.*\))?:.*$'
order: 4
- title: 🤖 Bumps
regexp: '^[[:xdigit:]]+: (gomod|build)\(deps\):.*$'
order: 5
- title: 🐒 Miscellaneous
order: 999

release:
github:
owner: unikraft
name: governance
draft: false
prerelease: false
mode: replace
header: |
## `governctl` {{ .Tag }} ({{ .Date }})
This is a stable release of `governctl`.
name_template: 'v{{ .Version }}'

nfpms:
- vendor: Unikraft
id: nfpm-default
maintainer: Alexander Jung <[email protected]>
description: Build and use highly customized and ultra-lightweight unikernels.
license: BSD 3-clause
bindir: /usr/local/bin
homepage: https://github.com/unikraft/governance
formats:
- deb
- rpm
- apk

builds:
- binary: governctl
main: ./cmd/governctl
env:
- CGO_ENABLED=0
- GOMOD=github.com/unikraft/governance
goos:
- linux
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X {{ .Env.GOMOD }}/internal/version.version={{ .Version }}
- -X {{ .Env.GOMOD }}/internal/version.commit={{ .Commit }}
- -X {{ .Env.GOMOD }}/internal/version.buildTime={{ .Date }}

0 comments on commit 2ca2584

Please sign in to comment.