Skip to content

Commit 57f6919

Browse files
committed
feat: reuse native build workflow to also perform it on PRs
1 parent 7cef5f1 commit 57f6919

File tree

3 files changed

+26
-66
lines changed

3 files changed

+26
-66
lines changed

.github/workflows/maven.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,21 @@ jobs:
2828

2929
steps:
3030
- uses: actions/checkout@v4
31+
3132
- name: Set up JDK 17
3233
uses: actions/setup-java@v4
3334
with:
3435
java-version: '21'
3536
distribution: 'temurin'
3637
cache: maven
38+
3739
- name: Build with Maven
3840
run: mvn -B package -Dquarkus.test.profile.tags='ci' --file pom.xml
3941

42+
native-check:
43+
name: Perform native build check with default platform
44+
uses: ./.github/workflows/native-build.yml
45+
4046
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
4147
# - name: Update dependency graph
4248
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

.github/workflows/native-build.yml

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@ name: Native build test
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
platform:
7+
required: false
8+
description: Binary platform
9+
type: string
10+
default: "macOS-latest"
11+
workflow_call:
12+
inputs:
13+
platform:
14+
required: false
15+
description: Binary platform
16+
type: string
17+
default: "macOS-latest"
518

619
jobs:
720
# Build native executable per runner
821
package:
9-
name: 'Build with Graal on ${{ matrix.os }}'
10-
strategy:
11-
fail-fast: true
12-
matrix:
13-
os: [ ubuntu-latest, macOS-latest, macos-13 ]
14-
runs-on: ${{ matrix.os }}
22+
name: 'Build with Graal on ${{ inputs.platform }}'
23+
runs-on: ${{ inputs.platform }}
1524
steps:
1625
- name: 'Check out repository'
1726
uses: actions/checkout@v4
@@ -31,7 +40,7 @@ jobs:
3140

3241
- name: 'Build project'
3342
run: mvn install -DskipTests
34-
43+
3544
- name: 'Build Native Image'
3645
run: |
3746
pushd server
@@ -49,21 +58,3 @@ jobs:
4958
with:
5059
name: power-server-${{ runner.os }}-${{ runner.arch }}
5160
path: server/target/distributions/*.tar.gz
52-
53-
check:
54-
needs: package
55-
runs-on: ubuntu-latest
56-
steps:
57-
- name: 'Download all build artifacts'
58-
uses: actions/download-artifact@v4
59-
with:
60-
path: artifacts
61-
pattern: power-server-*
62-
merge-multiple: true
63-
64-
- name: 'Release with JReleaser'
65-
env:
66-
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
run: |
68-
ls -la artifacts
69-
mvn -ntp -B --file server/pom.xml -Prelease -DartifactsDir=artifacts jreleaser:full-release -Djreleaser.dry.run=true -Djreleaser.select.current.platform

.github/workflows/release.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -78,50 +78,13 @@ jobs:
7878
# Build native executable per runner
7979
package:
8080
if: needs.maven-release.outputs.already_released != 'true'
81-
needs: [ maven-release ]
82-
name: 'Build with Graal on ${{ matrix.os }}'
81+
needs: [maven-release]
8382
strategy:
84-
fail-fast: true
8583
matrix:
8684
os: [ ubuntu-latest, macOS-latest, macos-13 ]
87-
runs-on: ${{ matrix.os }}
88-
steps:
89-
- name: 'Check out repository'
90-
uses: actions/checkout@v4
91-
92-
- uses: actions/setup-java@v4
93-
with:
94-
distribution: 'temurin'
95-
java-version: '21'
96-
cache: 'maven'
97-
98-
- uses: graalvm/setup-graalvm@v1
99-
with:
100-
java-version: '21'
101-
distribution: 'graalvm'
102-
github-token: ${{ secrets.GITHUB_TOKEN }}
103-
native-image-job-reports: 'true'
104-
105-
- name: 'Build project'
106-
run: mvn install -DskipTests
107-
108-
- name: 'Build Native Image'
109-
run: |
110-
pushd server
111-
mvn -ntp -B --file pom.xml -Pnative package -DskipTests
112-
popd
113-
114-
- name: 'Create distribution'
115-
run: |
116-
pushd server
117-
mvn -ntp -B --file pom.xml -Pdist package -DskipTests
118-
popd
119-
120-
- name: 'Upload build artifact'
121-
uses: actions/upload-artifact@v4
122-
with:
123-
name: power-server-${{ runner.os }}-${{ runner.arch }}
124-
path: server/target/distributions/*.tar.gz
85+
uses: ./.github/workflows/native-build.yml
86+
with:
87+
platform: ${{ matrix.os }}
12588

12689
# Collect all executables and release
12790
release:

0 commit comments

Comments
 (0)