Skip to content

Commit 4aa5127

Browse files
authored
Merge pull request #9 from alphagov/samsimpson1/goreleaser
Add goreleaser config
2 parents b4d8042 + 0d72ca7 commit 4aa5127

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

.goreleaser.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
before:
7+
hooks:
8+
- go mod tidy
9+
- make controller-gen
10+
- bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=crds
11+
12+
13+
builds:
14+
- main: cmd/main.go
15+
env:
16+
- CGO_ENABLED=0
17+
goos:
18+
- darwin
19+
- linux
20+
goarch:
21+
- arm64
22+
- amd64
23+
binary: manager
24+
25+
archives:
26+
- formats: ["tar.gz"]
27+
# this name template makes the OS and Arch compatible with the results of `uname`.
28+
name_template: >-
29+
{{ .ProjectName }}_
30+
{{- title .Os }}_
31+
{{- if eq .Arch "amd64" }}x86_64
32+
{{- else if eq .Arch "386" }}i386
33+
{{- else }}{{ .Arch }}{{ end }}
34+
{{- if .Arm }}v{{ .Arm }}{{ end }}
35+
files:
36+
- crds/*
37+
38+
changelog:
39+
sort: asc
40+
filters:
41+
exclude:
42+
- "^docs:"
43+
- "^test:"
44+
45+
release:
46+
draft: false
47+
use_existing_draft: true
48+
replace_existing_artifacts: true
49+
50+
dockers_v2:
51+
- dockerfile: goreleaser.Dockerfile
52+
images:
53+
- "ghcr.io/alphagov/govuk-job-request-operator"
54+
tags:
55+
- "v{{ .Version }}"
56+
platforms:
57+
- linux/amd64
58+
- linux/arm64
59+
sbom: false
60+
#disable: "{{ .IsSnapshot }}"

goreleaser.Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM scratch
2+
ARG TARGETPLATFORM
3+
ENTRYPOINT [ "/manager" ]
4+
USER 65532:65532
5+
COPY ${TARGETPLATFORM}/manager /manager
6+
7+
LABEL org.opencontainers.image.source "https://github.com/alphagov/govuk-job-request-operator"

0 commit comments

Comments
 (0)