-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (44 loc) · 1.79 KB
/
perform-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
name: Perform Release
on:
workflow_dispatch:
inputs:
tag:
description: 'New tag name'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Generate github token with elevated perms
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.AUTOMERGE_APP_ID }}
private_key: ${{ secrets.AUTOMERGE_PRIVATE_KEY }}
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ steps.generate_token.outputs.token }}
- uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Update version
run: |
# Helm version
yq e -i '.version = "${{ github.event.inputs.tag }}"' helm/cloudflare-zero-trust-operator/Chart.yaml
yq e -i '.appVersion = "${{ github.event.inputs.tag }}"' helm/cloudflare-zero-trust-operator/Chart.yaml
yq e -i '.images[0].newTag = "${{ github.event.inputs.tag }}"' config/manager/kustomization.yaml
# Version in README.md
sed -i.bak -e '/<!-- Version_Placeholder -->/ {' -e 'n; s|.*|![Version: ${{ github.event.inputs.tag }}](https://img.shields.io/badge/Version-${{ github.event.inputs.tag }}-informational?style=flat-square)|' -e '}' README.md && rm README.md.bak
# Build Manifests
make manifests
# Build Helm chart
make helm
- name: Commit
uses: EndBug/add-and-commit@v9
with:
commit: '--allow-empty'
push: true
tag: ${{ github.event.inputs.tag }}
message: Build Release ${{ github.event.inputs.tag }}