Skip to content

Commit 99079e3

Browse files
committed
wip: switching to goreleaser for building & packaging
1 parent afda5e3 commit 99079e3

5 files changed

Lines changed: 109 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
package:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout the repo
11+
uses: actions/checkout@v6
12+
13+
- name: Install taskfile
14+
run: sudo snap install task --classic
15+
16+
- name: Package Helm chart
17+
run: task build:plugin

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/helm-values
2-
/dist
32
*.tgz
3+
*.tgz.prov
4+
# Added by goreleaser init:
5+
dist/

.goreleaser.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
11+
before:
12+
hooks:
13+
# You may remove this if you don't use go modules.
14+
- go mod tidy
15+
# you may remove this if you don't need go generate
16+
- go generate ./...
17+
18+
builds:
19+
- main: ./cmd/helm-values
20+
env:
21+
- CGO_ENABLED=0
22+
goos:
23+
- linux
24+
- windows
25+
- darwin
26+
27+
archives:
28+
- format: tgz
29+
# this name template makes the OS and Arch compatible with the results of `uname`.
30+
name_template: >-
31+
{{ .ProjectName }}_
32+
{{- title .Os }}_
33+
{{- if eq .Arch "amd64" }}x86_64
34+
{{- else if eq .Arch "386" }}i386
35+
{{- else }}{{ .Arch }}{{ end }}
36+
{{- if .Arm }}v{{ .Arm }}{{ end }}
37+
# use zip for windows archives
38+
format_overrides:
39+
- goos: windows
40+
formats: [zip]
41+
files:
42+
- plugin.yaml
43+
44+
changelog:
45+
sort: asc
46+
filters:
47+
exclude:
48+
- "^docs:"
49+
- "^test:"
50+
51+
release:
52+
footer: >-
53+
54+
---
55+
56+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

plugin.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,38 @@ config:
88
shortHelp: Schema and docs generator for Helm values
99
runtimeConfig:
1010
platformCommand:
11-
- command: ${HELM_PLUGIN_DIR}/helm-values
11+
- os: darwin
12+
command: ${HELM_PLUGIN_DIR}/helm-values
13+
- os: linux
14+
command: ${HELM_PLUGIN_DIR}/helm-values
15+
- os: windows
16+
command: ${HELM_PLUGIN_DIR}/helm-values.exe
17+
platformHooks: # Configure plugin lifecycle hooks based on the platform
18+
install: # Install lifecycle commands
19+
- os: darwin
20+
arch: arm64
21+
command: echo "hello world"
22+
- os: darwin
23+
arch: x86
24+
command: ${HELM_PLUGIN_DIR}/helm-values
25+
- os: linux
26+
arch: arm64
27+
command: ${HELM_PLUGIN_DIR}/helm-values
28+
- os: linux
29+
arch: i386
30+
command: ${HELM_PLUGIN_DIR}/helm-values
31+
- os: linux
32+
arch: x86
33+
command: ${HELM_PLUGIN_DIR}/helm-values
34+
- os: windows
35+
arch: arm64
36+
command: ${HELM_PLUGIN_DIR}/helm-values.exe
37+
- os: windows
38+
arch: i386
39+
command: ${HELM_PLUGIN_DIR}/helm-values.exe
40+
- os: windows
41+
arch: x86
42+
command: ${HELM_PLUGIN_DIR}/helm-values.exe
1243

1344
# legacy metadata, needed for artifacthub
1445
description:

taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ tasks:
2424
- mkdir -p dist
2525
- cp helm-values dist/helm-values
2626
- cp plugin.yaml dist/plugin.yaml
27-
- helm plugin package ./dist
27+
- helm plugin package ./dist --sign=false

0 commit comments

Comments
 (0)