Skip to content

Commit e315cbb

Browse files
committed
Setup release branches
1 parent 0e0c77b commit e315cbb

9 files changed

+180
-5
lines changed

.github/workflows/merge-to-master.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
GO111MODULE: on
1111
K8S_VERSION: "1.19.2"
1212
CONTAINER_RUNTIME: "docker"
13+
OPERATOR_REPO_REF: "quay.io/pmacik/sbo-test"
1314

1415
jobs:
1516
release:
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Merge to release branches
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
8+
env:
9+
SDK_VERSION: "1.16.0"
10+
GO111MODULE: on
11+
K8S_VERSION: "1.19.2"
12+
CONTAINER_RUNTIME: "docker"
13+
OPERATOR_REPO_REF: "quay.io/pmacik/sbo-test"
14+
15+
jobs:
16+
release:
17+
name: Release operator on Quay.io
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout Git Repository
22+
uses: actions/checkout@v2
23+
24+
- name: Set up PATH
25+
run: |
26+
mkdir -p $GITHUB_WORKSPACE/bin/
27+
echo "PATH=$PATH:$GITHUB_WORKSPACE/bin/" >> $GITHUB_ENV
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v2
31+
with:
32+
go-version: "^1.16"
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v2
36+
with:
37+
python-version: "3.7"
38+
architecture: "x64"
39+
40+
- name: Setup CLI
41+
uses: ./.github/actions/setup-cli
42+
with:
43+
operator-sdk: true
44+
kubectl: true
45+
46+
- name: Release operator on Quay.io
47+
env:
48+
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
49+
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
50+
run: |
51+
export OPERATOR_INDEX_IMAGE_REF=$OPERATOR_REPO_REF:index-${GITHUB_REF_NAME#release/}
52+
make release-operator
53+
54+
unit-tests-with-coverage:
55+
name: Unit tests with code coverage for merge-to-master commits
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- name: Checkout Git Repository
60+
uses: actions/checkout@v2
61+
62+
- name: Set up Go
63+
uses: actions/setup-go@v2
64+
with:
65+
go-version: "^1.16"
66+
67+
- name: Unit Tests with Code Coverage
68+
run: |
69+
make test
70+
71+
- name: Upload Code Coverage Report
72+
uses: codecov/codecov-action@v3
73+
with:
74+
file: cover.out
75+
verbose: true
76+
fail_ci_if_error: true
77+
78+
security-scan:
79+
name: Security vulnerability scan
80+
runs-on: ubuntu-20.04
81+
steps:
82+
- name: Checkout code
83+
uses: actions/checkout@v2
84+
85+
- name: Wait for push
86+
uses: lewagon/wait-on-check-action@1b1630e169116b58a4b933d5ad7effc46d3d312d
87+
with:
88+
ref: ${{ github.ref }}
89+
check-name: "Release operator on Quay.io"
90+
repo-token: ${{ secrets.GITHUB_TOKEN }}
91+
wait-interval: 60
92+
93+
- name: Extract operator image ref
94+
id: operator-image-ref
95+
run: |
96+
export OIR=${OPERATOR_REPO_REF}:$(git rev-parse --short=8 HEAD)
97+
echo "::set-output name=operator-image-ref::${OIR}"
98+
99+
- name: Run Trivy vulnerability scanner in IaC mode
100+
uses: aquasecurity/trivy-action@master
101+
with:
102+
image-ref: ${{ steps.operator-image-ref.outputs.operator-image-ref }}
103+
format: 'sarif'
104+
severity: 'CRITICAL,HIGH'
105+
ignore-unfixed: true
106+
output: 'trivy-results.sarif'
107+
108+
- name: Upload Trivy scan results to GitHub Security tab
109+
if: always()
110+
uses: github/codeql-action/upload-sarif@v2
111+
with:
112+
sarif_file: 'trivy-results.sarif'

.github/workflows/pr-checks-build-images.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on:
44
pull_request:
55
branches:
66
- master
7+
- 'release/**'
78

89
env:
910
SDK_VERSION: "1.16.0"
1011
CONTAINER_RUNTIME: "podman"
1112
ARTIFACTS: "artifacts"
12-
REGISTRY_PREFIX: quay.io/redhat-developer
13-
REPO: servicebinding-operator
13+
REGISTRY_PREFIX: quay.io/pmacik
14+
REPO: sbo-test
1415

1516
jobs:
1617
build-operator-images:

.github/workflows/pr-checks-clean-images.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
pull_request_target:
55
branches:
66
- master
7+
- 'release/**'
78
types: [closed]
89

910
env:
10-
OPERATOR_REPO_REF: quay.io/redhat-developer/servicebinding-operator
11+
OPERATOR_REPO_REF: quay.io/pmacik/sbo-test
1112

1213
jobs:
1314
clean-operator-images:

.github/workflows/pr-checks-push-images.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
pull_request_target:
55
branches:
66
- master
7+
- 'release/**'
78

89
env:
9-
REGISTRY_PREFIX: quay.io/redhat-developer
10-
REPO: servicebinding-operator
10+
REGISTRY_PREFIX: quay.io/pmacik
11+
REPO: sbo-test
1112

1213
jobs:
1314
push-operator-images:

.github/workflows/pr-checks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches:
66
- master
7+
- 'release/**'
78

89
env:
910
GO111MODULE: on
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Clean cherry-pick PR branch"
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- 'release/**'
7+
types: [closed]
8+
9+
env:
10+
OPERATOR_REPO_REF: quay.io/pmacik/sbo-test
11+
12+
jobs:
13+
delete-cherry-pick-branch:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Delete cherry-pick branch
17+
uses: SvanBoxel/delete-merged-branch@main
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
delete_closed_pr: true
22+
exclude:
23+
master, release/*
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Cherry pick PR to release branches"
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- master
7+
types: [closed]
8+
9+
env:
10+
OPERATOR_REPO_REF: quay.io/pmacik/sbo-test
11+
12+
jobs:
13+
cherry_pick_release_v1_1_x:
14+
runs-on: ubuntu-latest
15+
name: Cherry pick into release/v1.1.x
16+
if: contains(github.event.pull_request.labels.*.name, 'release/v1.1.x') && github.event.pull_request.merged
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- name: Setup SSH for cherry-pick repo
23+
uses: webfactory/[email protected]
24+
with:
25+
ssh-private-key: ${{ secrets.SBO_CHERRY_PICK_REPO_SSH_PRIVATE_KEY }}
26+
- name: Cherry pick into release/v1.1.x
27+
uses: pmacik/github-cherry-pick-action@exclude-pr-labels
28+
with:
29+
cherry-pick-repo: ${{ secrets.SBO_CHERRY_PICK_REPO }}
30+
token: ${{ secrets.SBO_CHERRY_PICK_BOT_TOKEN }}
31+
branch: release/v1.1.x
32+
labels: |
33+
cherry-pick
34+
title-prefix: "[cherry-pick(release/1.1.x)] "

.github/workflows/pr-labels.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request_target:
55
branches:
66
- master
7+
- 'release/**'
78

89
jobs:
910
acceptance-tests-skipped-label:

0 commit comments

Comments
 (0)