Files
kubernetes-images-sync-oper…/.goreleaser.yaml
T

178 lines
4.7 KiB
YAML

# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
project_name: kubernetes-images-sync-operator
before:
hooks:
- go mod tidy
# Update Helm chart version to match release version
- "sed -i.bak 's/^version:.*/version: {{ .Version }}/' charts/kube-images-sync-operator/Chart.yaml"
- 'sed -i.bak ''s/^appVersion:.*/appVersion: "{{ .Version }}"/'' charts/kube-images-sync-operator/Chart.yaml'
- 'sed -i.bak ''s/tag:.*/tag: "{{ .Version }}"/'' charts/kube-images-sync-operator/values.yaml'
- 'sed -i.bak ''s/workerImage:.*/workerImage: ghcr.io\/lukaszraczylo\/kubernetes-images-sync-worker:{{ .Version }}/'' charts/kube-images-sync-operator/values.yaml'
- rm -f charts/kube-images-sync-operator/Chart.yaml.bak charts/kube-images-sync-operator/values.yaml.bak
builds:
- id: manager
main: ./cmd
binary: manager
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X github.com/lukaszraczylo/kubernetes-images-sync-operator/internal/shared.BACKUP_JOB_IMAGE=ghcr.io/lukaszraczylo/kubernetes-images-sync-worker:{{.Version}}
goos:
- linux
- darwin
goarch:
- amd64
- arm64
- id: worker
main: ./cmd/worker
binary: worker
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w
- -X main.Version={{.Version}}
goos:
- linux
goarch:
- amd64
- arm64
archives:
- id: default
ids:
- manager
formats:
- tar.gz
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- .Os }}_
{{- .Arch }}
files:
- README.md
format_overrides:
- goos: windows
formats:
- zip
checksum:
name_template: "checksums.txt"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
- Merge pull request
- Merge branch
release:
github:
owner: lukaszraczylo
name: kubernetes-images-sync-operator
draft: false
prerelease: auto
name_template: "v{{.Version}}"
header: |
## Kubernetes Images Sync Operator v{{.Version}}
Kubernetes operator for backing up and syncing container images across environments.
### Installation
**Helm (from repository):**
```bash
helm repo add kube-images-sync https://lukaszraczylo.github.io/helm-charts
helm repo update
helm install kube-images-sync kube-images-sync/kube-images-sync --version {{.Version}}
```
**Helm (from release asset):**
```bash
helm install kube-images-sync https://github.com/lukaszraczylo/kubernetes-images-sync-operator/releases/download/v{{.Version}}/kube-images-sync-{{.Version}}.tgz
```
**Docker:**
```bash
docker pull ghcr.io/lukaszraczylo/kubernetes-images-sync-operator:{{.Version}}
docker pull ghcr.io/lukaszraczylo/kubernetes-images-sync-worker:{{.Version}}
```
dockers_v2:
- id: operator
ids:
- manager
images:
- "ghcr.io/lukaszraczylo/kubernetes-images-sync-operator"
tags:
- "{{ .Version }}"
- "latest"
platforms:
- linux/amd64
- linux/arm64
dockerfile: Dockerfile.goreleaser
labels:
"org.opencontainers.image.title": "{{ .ProjectName }}"
"org.opencontainers.image.version": "{{ .Version }}"
"org.opencontainers.image.source": "https://github.com/lukaszraczylo/kubernetes-images-sync-operator"
"org.opencontainers.image.description": "Kubernetes operator for backing up and syncing container images"
- id: worker
ids:
- worker
images:
- "ghcr.io/lukaszraczylo/kubernetes-images-sync-worker"
tags:
- "{{ .Version }}"
- "latest"
platforms:
- linux/amd64
- linux/arm64
dockerfile: Dockerfile.worker
extra_files:
- docker-image-worker/storage.conf
- docker-image-worker/containers.conf
- docker-image-worker/registries.conf
- docker-image-worker/podman-preauth.sh
labels:
"org.opencontainers.image.title": "kubernetes-images-sync-worker"
"org.opencontainers.image.version": "{{ .Version }}"
"org.opencontainers.image.source": "https://github.com/lukaszraczylo/kubernetes-images-sync-operator"
"org.opencontainers.image.description": "Worker image for backing up container images to S3 or local storage"
signs:
- cmd: cosign
signature: "${artifact}.sigstore.json"
args:
- sign-blob
- "--bundle=${signature}"
- "${artifact}"
- "--yes"
artifacts: checksum
output: true
docker_signs:
- cmd: cosign
artifacts: images
output: true
args:
- sign
- "${artifact}@${digest}"
- "--yes"