forked from strimzi/strimzi-kafka-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (141 loc) · 4.01 KB
/
build.yml
File metadata and controls
153 lines (141 loc) · 4.01 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Build
on:
push:
branches:
- "main"
- "release-*"
pull_request:
branches:
- "*"
# Cancel previous builds on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Build Strimzi Java code and does basic checks of the PR
build-strimzi:
name: Build Strimzi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Build workflow trigger via pull_request will have merge commit sha in github.sha
- name: Store build commit sha
run: |
echo "${{ github.sha }}" > commit-sha.txt
echo "Stored commit SHA: ${{ github.sha }}"
- name: Upload build metadata
uses: actions/upload-artifact@v4
with:
name: commit-sha.txt
path: commit-sha.txt
- uses: ./.github/actions/build/build-strimzi-binaries
with:
mvnArgs: "-B -DskipTests -Dmaven.javadoc.skip=true"
runnerArch: "amd64"
# Runs Strimzi unit and integration tests
test-strimzi:
name: Strimzi Unit & IT tests
needs:
- build-strimzi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/build/test-strimzi
with:
runnerArch: "amd64"
env:
# Use the oldest supported kubernetes version within Kind
KIND_NODE_IMAGE: "oldest"
# Builds Strimzi docs
build-docs:
name: Build docs
needs:
- build-strimzi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/build/build-docs
with:
artifactName: "documentation.tar"
runnerArch: "amd64"
# Builds Strimzi containers
build-containers:
name: Build Containers
needs:
- build-strimzi
strategy:
matrix:
architecture:
- amd64
- arm64
- s390x
- ppc64le
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/build/containers-build
with:
architecture: ${{ matrix.architecture }}
runnerArch: "amd64"
# Push Strimzi containers - run only on main branch
push-containers:
name: Push Containers
needs:
- build-strimzi
- test-strimzi
- build-containers
- build-docs
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# Required for keyless signing with GitHub OIDC
id-token: write
env:
DOCKER_REGISTRY: "quay.io"
DOCKER_ORG: "strimzi"
DOCKER_TAG: "latest"
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/build/containers-push
with:
architectures: "amd64,arm64,ppc64le,s390x"
runnerArch: "amd64"
quayUser: ${{ secrets.QUAY_USER }}
quayPass: ${{ secrets.QUAY_PASS }}
# Publish Strimzi docs to the website - run only on main branch
publish-docs:
name: Publish Docs
needs:
- build-strimzi
- test-strimzi
- build-containers
- build-docs
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/build/publish-docs
with:
artifactName: "documentation.tar"
websiteDeployKey: ${{ secrets.WEBSITE_DEPLOY_KEY }}
# Deploy Strimzi Java artifacts - run only on main branch
deploy-java:
name: Deploy Java artifacts
needs:
- build-strimzi
- test-strimzi
- build-containers
- build-docs
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/build/deploy-java
with:
runnerArch: "amd64"
gpgPassphrase: ${{ secrets.GPG_PASSPHRASE }}
gpgSigningKey: ${{ secrets.GPG_SIGNING_KEY }}
centralUsername: ${{ secrets.CENTRAL_USERNAME }}
centralPassword: ${{ secrets.CENTRAL_PASSWORD }}