diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ff876ae --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..5031dba --- /dev/null +++ b/.goreleaser.yml @@ -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 + 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 }}