-
Notifications
You must be signed in to change notification settings - Fork 29
64 lines (64 loc) · 2.29 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
name: "Release"
on: # yamllint disable-line rule:truthy
push:
tags:
- "*"
permissions:
contents: "write"
packages: "write"
env:
GO_VERSION: "~1.22"
jobs:
goreleaser:
runs-on: "ubuntu-latest"
env:
KUSTOMIZER_ARTIFACT: "oci://ghcr.io/${{github.repository_owner}}/${{github.event.repository.name}}-manifests"
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- uses: "authzed/actions/setup-go@main"
with:
go-version: "${{ env.GO_VERSION }}"
- uses: "authzed/actions/docker-login@main"
with:
quayio_token: "${{ secrets.QUAYIO_PASSWORD }}"
github_token: "${{ secrets.GITHUB_TOKEN }}"
dockerhub_token: "${{ secrets.DOCKERHUB_ACCESS_TOKEN }}"
- uses: "docker/setup-qemu-action@v3"
- uses: "docker/setup-buildx-action@v3"
# the release directory is gitignored, which keeps goreleaser from
# complaining about a dirty tree
- name: "Copy manifests to release directory"
run: |
mkdir release
cp -R config release
- name: "Set operator image in release manifests"
uses: "mikefarah/yq@master"
with:
cmd: |
yq eval '.images[0].newTag="${{ github.ref_name }}"' -i ./release/config/kustomization.yaml
- name: "Build release bundle.yaml"
uses: "karancode/kustomize-github-action@master"
with:
kustomize_build_dir: "release/config"
kustomize_output_file: "release/bundle.yaml"
- uses: "goreleaser/goreleaser-action@v6"
with:
distribution: "goreleaser-pro"
version: "latest"
args: "release --rm-dist"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
- name: "Setup Kustomizer CLI"
uses: "stefanprodan/kustomizer/action@main"
- name: "Push release manifests"
run: |
kustomizer push artifact ${KUSTOMIZER_ARTIFACT}:${{ github.ref_name }} -k ./release/config \
--source=${{ github.repositoryUrl }} \
--revision="${{ github.ref_name }}/${{ github.sha }}"
- name: "Tag latest release manifests"
run: |
kustomizer tag artifact ${KUSTOMIZER_ARTIFACT}:${GITHUB_REF_NAME} latest