-
Notifications
You must be signed in to change notification settings - Fork 24
97 lines (83 loc) · 3.39 KB
/
release-discover-branches.yaml
File metadata and controls
97 lines (83 loc) · 3.39 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
name: Discover branches
on:
pull_request:
branches:
- '**'
push:
branches:
- 'main'
schedule:
- cron: "0 5 * * *" # Daily at 05:00.
workflow_dispatch: # Manual workflow trigger
jobs:
discover-branches:
name: generate-ci
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
steps:
- name: Checkout openshift-knative/hack
uses: actions/checkout@v3
with:
path: ./src/github.com/openshift-knative/hack
- name: Setup Golang
uses: ./src/github.com/openshift-knative/hack/actions/setup-go
- uses: tektoncd/actions/setup-tektoncd-cli@main
with:
version: latest
- name: Install Kustomize
run: GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@latest
- name: Configure Git user
run: |
git config --global user.email "serverless-support@redhat.com"
git config --global user.name "OpenShift Serverless"
- name: Discover branches
working-directory: ./src/github.com/openshift-knative/hack
run: make discover-branches ARGS="--config config/"
- name: Update Konflux pipelines
working-directory: ./src/github.com/openshift-knative/hack
run: make konflux-update-pipelines
# The runner runs on Ubuntu and we need to have python3-dnf installed, so we'll use a container to run the rpm-lockfile-prototype
- name: Checkout rpm-lockfile-prototype
uses: actions/checkout@v3
with:
repository: 'konflux-ci/rpm-lockfile-prototype'
path: ./src/github.com/openshift-knative/rpm-lockfile-prototype
ref: 'v0.15.0'
- name: Install podman
run: |
sudo apt-get update
sudo apt-get -y install podman
- name: Build rpm-lockfile-prototype
working-directory: ./src/github.com/openshift-knative/rpm-lockfile-prototype
run: podman build -t localhost/rpm-lockfile-prototype:latest -f Containerfile .
- name: Update RPMs lock files
working-directory: ./src/github.com/openshift-knative/hack
run: |
container_dir=~/work
podman run --privileged \
--rm \
-v ${PWD}:${container_dir} \
localhost/rpm-lockfile-prototype:latest \
--outfile=${container_dir}/pkg/dockerfilegen/ubi8.rpms.lock.yaml \
${container_dir}/pkg/dockerfilegen/ubi8.rpms.in.yaml || exit $?
podman run --privileged \
--rm \
-v ${PWD}:${container_dir} \
localhost/rpm-lockfile-prototype:latest \
--outfile=${container_dir}/pkg/dockerfilegen/ubi9.rpms.lock.yaml \
${container_dir}/pkg/dockerfilegen/ubi9.rpms.in.yaml || exit $?
- name: Create Discovery Pull Request
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.SERVERLESS_QE_ROBOT }}
path: ./src/github.com/openshift-knative/hack
base: main
branch: discover-serverless-ci
title: "Add new midstream branches and update pipelines"
commit-message: "Discover new branches and update pipelines"
delete-branch: true
body: |
Discover new branches and update Konflux pipelines using openshift-knative/hack.