Skip to content

Commit aa9226e

Browse files
committed
workflow: add a workflow to automate OLM bundle submission
Signed-off-by: Feruzjon Muyassarov <[email protected]>
1 parent f09cb0e commit aa9226e

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Submit release OLM bundle
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
createPullRequest:
10+
name: Publish new OperatorHub release
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Build the bundle
19+
run: pushd deployment/operator && make bundle && popd
20+
21+
- name: Checkout upstream community-operators repo
22+
uses: actions/checkout@v4
23+
with:
24+
repository: k8s-operatorhub/community-operators
25+
path: community-operators
26+
ref: main
27+
token: ${{ secrets.BOT_PAT }}
28+
29+
- name: Import GPG key
30+
uses: crazy-max/ghaction-import-gpg@v6
31+
id: import-gpg
32+
with:
33+
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
34+
passphrase: ${{ secrets.BOT_PASSPHRASE }}
35+
git_user_signingkey: true
36+
git_commit_gpgsign: true
37+
workdir: community-operators
38+
39+
- name: Copy the bundle to the community-operators repo
40+
run: |
41+
mkdir -p community-operators/operators/nri-plugins-operator/${{ github.ref_name }}
42+
cp -r deployment/operator/bundle/ community-operators/operators/nri-plugins-operator/${{ github.ref_name }}
43+
44+
- name: Create Pull Request
45+
uses: peter-evans/create-pull-request@v6
46+
with:
47+
signoff: true
48+
author: nri-plugins-bot
49+
committer: "Github Actions <${{ steps.import-gpg.outputs.email }}>"
50+
add-paths: |
51+
operators/nri-plugins-operator/**
52+
path: community-operators
53+
push-to-fork: nri-plugins-bot/community-operators
54+
branch: olm-${{ github.ref_name }}
55+
token: ${{ secrets.BOT_PAT }}
56+
delete-branch: false
57+
title: 'nri-plugins-operator ${{ github.ref_name }}'
58+
commit-message: 'Submit operator nri-plugins-operator ${{ github.ref_name }}'
59+
body: |
60+
Added OLM bundle for [nri-plugins operator ${{ github.ref_name }}](https://github.com/containers/nri-plugins/releases/tag/${{ github.ref_name }})
61+
> Auto-generated by `Github Actions Bot`

0 commit comments

Comments
 (0)