Skip to content

Commit a282009

Browse files
committed
fix: update branch workflow to include additional artifact uploads and replace JDK distribution with GraalVM; remove deprecated native image release workflow and replace with a new implementation
1 parent 3378f27 commit a282009

4 files changed

Lines changed: 58 additions & 411 deletions

File tree

.github/workflows/branch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141
name: restheart-artifacts
4242
path: |
4343
core/target/restheart.jar
44+
core/target/restheart.tar.gz
45+
core/target/restheart.zip
4446
core/target/lib/*.jar
4547
core/target/plugins/*.jar
4648
core/target/plugins/lib/*.jar
@@ -57,7 +59,7 @@ jobs:
5759
- name: Set up JDK 25
5860
uses: actions/setup-java@v5
5961
with:
60-
distribution: "temurin"
62+
distribution: "graalvm"
6163
java-version: "25"
6264
cache: "maven"
6365
- name: Import private gpg key

.github/workflows/native-image-release.yml

Lines changed: 0 additions & 208 deletions
This file was deleted.

.github/workflows/native-image-snapshot.yml renamed to .github/workflows/native-image.yml

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
name: Native Image Snapshot
1+
name: Native Image
22

3-
on: workflow_dispatch # Manually trigger the workflow
3+
on:
4+
# Called by other workflows (e.g. tags.yml on release branches)
5+
workflow_call:
6+
inputs:
7+
version:
8+
description: "Version to release. Leave empty for snapshot build."
9+
required: false
10+
type: string
11+
default: ""
12+
# Manual trigger
13+
workflow_dispatch:
14+
inputs:
15+
version:
16+
description: "Version to release. Leave empty for snapshot build."
17+
required: false
18+
type: string
19+
default: ""
420

521
jobs:
622
build-and-upload:
723
runs-on: ${{ matrix.os }}
824
strategy:
25+
fail-fast: false
926
matrix:
1027
include:
1128
- os: ubuntu-latest
@@ -15,8 +32,6 @@ jobs:
1532
- os: macos-latest
1633
arch: "darwin-arm64"
1734
timeout-minutes: 60
18-
outputs:
19-
ubuntu: ${{ steps.set-output.outputs.ubuntu }}
2035
steps:
2136
- uses: actions/checkout@v6
2237

@@ -35,6 +50,7 @@ jobs:
3550
echo "JAVA_HOME: $JAVA_HOME"
3651
java --version
3752
native-image -march=list
53+
export MAVEN_OPTS="-Xmx8g -Xms4g"
3854
mvn package -Pnative -DskipTests \
3955
-Dnative.march="-march=armv8-a" \
4056
-Dquarkus.native.additional-build-args="-J-Xmx6g,-J-Xms4g,--gc=serial"
@@ -58,26 +74,30 @@ jobs:
5874
mvn package -Pnative -DskipTests -Dnative.march="-march=x86-64"
5975
chmod +x core/target/restheart
6076
61-
- name: Upload restheart-${{ matrix.arch }} native artifact
77+
- name: Upload native artifact
6278
uses: actions/upload-artifact@v6
6379
with:
6480
name: restheart-${{ matrix.arch }}
6581
path: ${{ matrix.arch == 'windows-amd64' && 'core/target/restheart.exe' || 'core/target/restheart' }}
6682
overwrite: true
6783

68-
- name: Set Output for docker-publish-linux Job
69-
if: matrix.arch == 'linux-amd64'
70-
id: set-output
71-
run: echo "ubuntu=true" >> $GITHUB_OUTPUT
84+
- name: Upload to release
85+
if: inputs.version != ''
86+
env:
87+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
run: |
89+
SRC=${{ matrix.arch == 'windows-amd64' && 'core/target/restheart.exe' || 'core/target/restheart' }}
90+
DST="restheart-${{ matrix.arch }}${{ matrix.arch == 'windows-amd64' && '.exe' || '' }}"
91+
cp "$SRC" "/tmp/$DST"
92+
gh release upload "${{ inputs.version }}" "/tmp/$DST" --clobber
7293
7394
docker-publish-linux:
7495
runs-on: ubuntu-latest
7596
needs: build-and-upload
76-
if: needs.build-and-upload.outputs.ubuntu == 'true'
7797
steps:
7898
- uses: actions/checkout@v6
7999

80-
- name: Download Binary Artifact
100+
- name: Download native artifact
81101
uses: actions/download-artifact@v5
82102
with:
83103
name: restheart-linux-amd64
@@ -95,23 +115,33 @@ jobs:
95115
username: ${{ secrets.DOCKER_USER }}
96116
password: ${{ secrets.DOCKER_TOKEN }}
97117

98-
- name: Set SHA
99-
id: vars
118+
- name: Set snapshot tags
119+
if: inputs.version == ''
120+
run: |
121+
SHA=$(echo ${GITHUB_SHA:0:7})
122+
TAGS="softinstigate/restheart-snapshot:${SHA}-native"
123+
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
124+
TAGS="${TAGS},softinstigate/restheart-snapshot:latest-native"
125+
fi
126+
echo "TAGS=${TAGS}" >> $GITHUB_ENV
127+
128+
- name: Set release tags
129+
if: inputs.version != ''
100130
run: |
101-
echo "SHA=$(echo ${GITHUB_SHA:0:7})" >> $GITHUB_ENV
131+
VERSION="${{ inputs.version }}"
132+
MAJOR=$(echo "$VERSION" | cut -d '.' -f 1)
133+
MINOR=$(echo "$VERSION" | cut -d '.' -f 2)
134+
PATCH=$(echo "$VERSION" | cut -d '.' -f 3)
135+
echo "TAGS=softinstigate/restheart:latest-native,softinstigate/restheart:${MAJOR}-native,softinstigate/restheart:${MAJOR}.${MINOR}-native,softinstigate/restheart:${MAJOR}.${MINOR}.${PATCH}-native" >> $GITHUB_ENV
102136
103-
- name: Build and Push multi-arch native Docker images
137+
- name: Build and push multi-arch native Docker images
104138
uses: docker/build-push-action@v7
105139
with:
106140
context: ./core/
107141
file: ./core/Dockerfile.native
108-
platforms: |
109-
linux/amd64,
110-
linux/arm64,
111-
linux/ppc64le,
112-
linux/s390x
113-
push: true # push all images built
114-
pull: true # pull all required images before building
115-
tags: |
116-
softinstigate/restheart-snapshot:${{ env.SHA }}-native
117-
${{ github.ref == 'refs/heads/master' && 'softinstigate/restheart-snapshot:latest-native' || '' }}
142+
# Dockerfile.native copies a pre-built linux-amd64 binary.
143+
# Multi-arch requires cross-compilation or per-platform builds.
144+
platforms: linux/amd64
145+
push: true
146+
pull: true
147+
tags: ${{ env.TAGS }}

0 commit comments

Comments
 (0)