Skip to content

Commit 684b2d6

Browse files
authored
fix: properly enable nightly builds (#578)
* feat: enable specifying which branch to build * feat: automatically pick up latest quarkus version * feat: build and release nightly snapshot of next-fabric8-version branch * feat: use latest kind and OLM versions * fix: restore using OLM 0.23 * fix: only run native on ITs by default, also build samples in nightly
1 parent 352798f commit 684b2d6

File tree

4 files changed

+88
-32
lines changed

4 files changed

+88
-32
lines changed

.github/workflows/build-for-quarkus-version.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build with specific Quarkus version
22

33
on:
44
workflow_call:
@@ -9,13 +9,21 @@ on:
99
java-version:
1010
type: string
1111
required: true
12+
branch:
13+
type: string
14+
required: true
15+
native-modules:
16+
type: string
17+
required: true
1218

1319
jobs:
1420
build:
1521
runs-on: ubuntu-latest
1622

1723
steps:
1824
- uses: actions/checkout@v3
25+
with:
26+
ref: ${{ inputs.branch }}
1927

2028
- name: Set up Java
2129
uses: actions/setup-java@v3
@@ -25,32 +33,27 @@ jobs:
2533
cache: 'maven'
2634

2735
- name: Quarkus version
28-
run: |
29-
echo ${{inputs.quarkus-version}}
30-
shell: bash
36+
run: echo ${{inputs.quarkus-version}}
3137

3238
- name: Change Quarkus version
33-
run: |
34-
mvn versions:set-property -Dproperty=quarkus.version -DnewVersion=${{inputs.quarkus-version}}
35-
shell: bash
39+
run: mvn versions:set-property -Dproperty=quarkus.version -DnewVersion=${{inputs.quarkus-version}}
3640

3741
- name: Get Date
3842
id: get-date
39-
run: |
40-
echo "{date}={$(/bin/date -u "+%Y-%m")}" >> $GITHUB_OUTPUT
43+
run: echo "{date}={$(/bin/date -u "+%Y-%m")}" >> $GITHUB_OUTPUT
4144
shell: bash
4245

4346
- name: Build with Maven (JVM)
4447
run: mvn -B formatter:validate install --file pom.xml
4548

4649
- name: Build with Maven (Native)
47-
run: mvn -B formatter:validate install -Dnative --file pom.xml -pl '!docs'
50+
run: mvn -B formatter:validate install -Dnative --file pom.xml -pl '${{inputs.native-modules}}' -amd
4851

4952
- name: Kubernetes KinD Cluster
5053
uses: container-tools/kind-action@v2
5154
with:
52-
version: v0.11.1
5355
registry: true
56+
5457
- name: Install OPM and Operator SDK tool
5558
uses: redhat-actions/openshift-tools-installer@v1
5659
with:

.github/workflows/build.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build PRs and main when updated
22

33
on:
44
push:
@@ -23,25 +23,25 @@ on:
2323
- '.all-contributorsrc'
2424

2525
jobs:
26-
# get-quarkus-versions:
27-
# runs-on: ubuntu-latest
28-
# outputs:
29-
# matrix: ${{ steps.set-matrix.outputs.matrix }}
30-
# steps:
31-
# - id: set-matrix
32-
# run: |
33-
# versions=$(curl https://registry.quarkus.io/client/platforms | jq '[.platforms[].streams[].releases[].version | select(endswith("Final"))]')
34-
# echo "${versions}"
35-
# echo "{matrix}=${versions}" >> $GITHUB_OUTPUT
36-
build-for-quarkus-version:
37-
# needs: get-quarkus-versions
26+
latest-quarkus-version:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
quarkus_version: ${{ steps.latest-quarkus-version.outputs.value }}
30+
steps:
31+
- id: latest-quarkus-version
32+
uses: sergeysova/jq-action@v2
33+
with:
34+
cmd: curl https://registry.quarkus.io/client/platforms | jq '.platforms[0]."current-stream-id" as $current | .platforms[0].streams[] | select(.id == $current) | .releases[0].version'
35+
36+
build-for-latest-quarkus-version:
37+
needs:
38+
- latest-quarkus-version
3839
strategy:
3940
matrix:
40-
# quarkus-version: ${{ curl https://registry.quarkus.io/client/platforms | jq '.platforms[0]."current-stream-id" as $current | .platforms[0].streams[] | select(.id == $current)
41-
# | .releases[0].version' }}
42-
quarkus-version: [ 3.0.2.Final ]
4341
java-version: [ 11, 17 ]
4442
uses: ./.github/workflows/build-for-quarkus-version.yml
4543
with:
46-
quarkus-version: ${{matrix.quarkus-version}}
47-
java-version: ${{ matrix.java-version }}
44+
quarkus-version: ${{ needs.latest-quarkus-version.outputs.quarkus_version }}
45+
java-version: ${{ matrix.java-version }}
46+
branch: main
47+
native-modules: "integration-tests"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release snapshot of next-fabric8-version branch each day at midnight
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # run each day at midnight
6+
7+
jobs:
8+
latest-quarkus-version:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
quarkus_version: ${{ steps.latest-quarkus-version.outputs.value }}
12+
steps:
13+
- id: latest-quarkus-version
14+
uses: sergeysova/jq-action@v2
15+
with:
16+
cmd: curl https://registry.quarkus.io/client/platforms | jq '.platforms[0]."current-stream-id" as $current | .platforms[0].streams[] | select(.id == $current) | .releases[0].version'
17+
18+
build-for-latest-quarkus-version:
19+
needs:
20+
- latest-quarkus-version
21+
uses: ./.github/workflows/build-for-quarkus-version.yml
22+
with:
23+
quarkus-version: ${{ needs.latest-quarkus-version.outputs.quarkus_version }}
24+
java-version: 17
25+
branch: "next-fabric8-version"
26+
native-modules: "integration-tests,samples"
27+
28+
release-snapshot:
29+
runs-on: ubuntu-latest
30+
needs:
31+
- build-for-latest-quarkus-version
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
with:
36+
ref: "next-fabric8-version"
37+
38+
- name: Import GPG key
39+
id: import_gpg
40+
uses: crazy-max/[email protected]
41+
with:
42+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
43+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
44+
45+
- uses: actions/setup-java@v3
46+
with:
47+
distribution: temurin
48+
java-version: 17
49+
cache: 'maven'
50+
51+
- name: Maven release
52+
run: |
53+
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.GPG_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
54+
mvn -B deploy -DperformRelease -Dno-samples -Prelease -s maven-settings.xml

.github/workflows/snapshot-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Snapshot Release
1+
name: Release Snapshots of main and next on push
22

33
concurrency:
44
group: ${{ github.ref }}-${{ github.workflow }}
@@ -10,7 +10,6 @@ on:
1010
jobs:
1111
release-snapshot:
1212
runs-on: ubuntu-latest
13-
name: snapshot-release
1413

1514
steps:
1615
- uses: actions/checkout@v3
@@ -28,7 +27,7 @@ jobs:
2827
java-version: 11
2928
cache: 'maven'
3029

31-
- name: Maven release ${{steps.metadata.outputs.current-version}}
30+
- name: Maven release
3231
run: |
3332
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.GPG_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
3433
mvn -B deploy -DperformRelease -Dno-samples -Prelease -s maven-settings.xml

0 commit comments

Comments
 (0)