-
Notifications
You must be signed in to change notification settings - Fork 146
75 lines (69 loc) · 3.06 KB
/
operatorhub.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
65
66
67
68
69
70
71
72
73
74
75
name: Publish OperatorHub release
on:
workflow_run:
workflows:
- Release
types:
- completed
jobs:
update:
name: Publish new OperatorHub release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && ! contains(github.event.workflow_run.head_branch, '-') }}
strategy:
matrix:
repo:
- fork: VictoriaMetrics/operatorhub-operators
upstream: k8s-operatorhub/community-operators
- fork: VictoriaMetrics/openshift-community-operators-prod
upstream: redhat-openshift-ecosystem/community-operators-prod
steps:
- name: Check out OperatorHub operators repo fork
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo.upstream }}
ref: main
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: __k8s-operatorhub-repo
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: import-gpg
with:
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
workdir: __k8s-operatorhub-repo
- uses: dawidd6/action-download-artifact@v6
with:
name: olm
workflow: main.yaml
github_token: ${{ secrets.VM_BOT_GH_TOKEN }}
run_id: ${{ github.event.workflow_run.id }}
path: bundle
- name: Add operatorhub bundle
id: update
run: |
VERSION=$(ls bundle | head -1)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
export MANIFEST_PATH=bundle/${VERSION}/manifests/victoriametrics-operator.clusterserviceversion.yaml
export REPLACE_VERSION=$(find __k8s-operatorhub-repo/operators/victoriametrics-operator/* -maxdepth 0 -type d -exec basename {} \; | sort -V -r | head -1)
yq -i '.spec.replaces = "victoriametrics-operator.v" + strenv(REPLACE_VERSION)' $MANIFEST_PATH
mkdir -p __k8s-operatorhub-repo/operators/victoriametrics-operator
mv bundle/* __k8s-operatorhub-repo/operators/victoriametrics-operator/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
add-paths: operators/victoriametrics-operator
commit-message: 'victoriametrics-operator: ${{ steps.update.outputs.VERSION }}'
signoff: true
committer: "Github Actions <${{ steps.import-gpg.outputs.email }}>"
path: __k8s-operatorhub-repo
push-to-fork: ${{ matrix.repo.fork }}
branch: vm-operator-release-${{ steps.update.outputs.VERSION }}
token: ${{ secrets.VM_BOT_GH_TOKEN }}
delete-branch: true
title: 'victoriametrics-operator: (${{ steps.update.outputs.VERSION }})'
body: |
Added OLM package for [VictoriaMetrics operator ${{ steps.update.outputs.VERSION }}"](https://github.com/VictoriaMetrics/operator/releases/tag/v${{ steps.update.outputs.VERSION }})
> Auto-generated by `Github Actions Bot`