Skip to content

Commit 7949a25

Browse files
committed
chore: publish releases using goreleaser
1 parent 78c24ca commit 7949a25

File tree

5 files changed

+142
-0
lines changed

5 files changed

+142
-0
lines changed

.devcontainer/devcontainer.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"ghcr.io/devcontainers/features/docker-in-docker": {},
1616
"ghcr.io/dhoeric/features/act": {},
1717
},
18+
"postCreateCommand": ".devcontainer/post-create.sh",
1819
"customizations": {
1920
"vscode": {
2021
"extensions": [

.devcontainer/post-create.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Install Go releaser
4+
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
5+
sudo apt update
6+
sudo apt install -y goreleaser
7+
8+
# Install Syft CLI
9+
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sudo sh -s -- -b /usr/local/bin

.github/workflows/release.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
pull_request:
5+
push:
6+
# run only against tags
7+
tags:
8+
- "*"
9+
10+
permissions:
11+
contents: write
12+
packages: write
13+
issues: write
14+
id-token: write
15+
16+
jobs:
17+
goreleaser:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Install Syft CLI
25+
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sudo sh -s -- -b /usr/local/bin
26+
- name: Set up Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: stable
30+
# More assembly might be required: Docker logins, GPG, etc.
31+
# It all depends on your needs.
32+
- name: Run GoReleaser
33+
uses: goreleaser/goreleaser-action@v6
34+
with:
35+
# either 'goreleaser' (default) or 'goreleaser-pro'
36+
distribution: goreleaser
37+
# 'latest', 'nightly', or a semver
38+
version: "~> v2"
39+
args: release --clean
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.TAP_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore goreleaser output
2+
dist/

.goreleaser.yaml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# For more information on configuring GoReleaser, refer to the documentation:
2+
# https://goreleaser.com
3+
#
4+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
5+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
6+
version: 2
7+
8+
before:
9+
hooks:
10+
- go mod tidy
11+
- go generate ./...
12+
13+
builds:
14+
- env:
15+
- CGO_ENABLED=0
16+
goos:
17+
- linux
18+
- windows
19+
- darwin
20+
21+
archives:
22+
- format: tar.gz
23+
# this name template makes the OS and Arch compatible with the results of `uname`.
24+
name_template: >-
25+
{{ .ProjectName }}_
26+
{{- title .Os }}_
27+
{{- if eq .Arch "amd64" }}x86_64
28+
{{- else if eq .Arch "386" }}i386
29+
{{- else }}{{ .Arch }}{{ end }}
30+
{{- if .Arm }}v{{ .Arm }}{{ end }}
31+
# use zip for windows archives
32+
format_overrides:
33+
- goos: windows
34+
format: zip
35+
36+
nfpms:
37+
- vendor: Datum Technology, Inc
38+
homepage: https://www.datum.net/
39+
maintainer: [email protected]
40+
license: Apache 2.0
41+
provides:
42+
- datumctl
43+
recommends:
44+
- kubectl
45+
formats:
46+
- apk
47+
- deb
48+
- rpm
49+
- termux.deb
50+
- archlinux
51+
52+
changelog:
53+
sort: asc
54+
filters:
55+
exclude:
56+
- "^docs:"
57+
- "^test:"
58+
- "^chore:"
59+
60+
release: {}
61+
62+
sboms:
63+
- artifacts: archive
64+
65+
brews:
66+
- name: cli
67+
commit_author:
68+
name: Datum Release Bot
69+
70+
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
71+
directory: Formula
72+
homepage: "https://www.datum.net/"
73+
description: "A network cloud, built on open source."
74+
license: "Apache 2.0"
75+
repository:
76+
owner: datum-cloud
77+
name: homebrew-tap
78+
branch: main
79+
80+
krews:
81+
- commit_author:
82+
name: goreleaserbot
83+
84+
commit_msg_template: "Krew plugin update for {{ .ProjectName }} version {{ .Tag }}"
85+
homepage: "https://www.datum.net/"
86+
description: "Software to create fast and easy drum rolls."
87+
short_description: "Software to create fast and easy drum rolls."
88+
# TODO: Remove once we configure pushing to a different repo
89+
skip_upload: true

0 commit comments

Comments
 (0)