Skip to content

Commit f65e8e2

Browse files
Switch the release to also use native builder workflow
1 parent 075d0a8 commit f65e8e2

3 files changed

Lines changed: 6 additions & 64 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -124,70 +124,9 @@ jobs:
124124
name: Build native test server
125125
needs: create_draft_release
126126
if: github.event.inputs.do_build_native_images == 'true'
127-
strategy:
128-
fail-fast: false
129-
matrix:
130-
include:
131-
- runner: ubuntu-latest
132-
os_family: linux
133-
arch: amd64
134-
- runner: macos-13
135-
os_family: macOS
136-
arch: amd64
137-
- runner: macos-latest
138-
os_family: macOS
139-
arch: arm64
140-
- runner: ubuntu-24.04-arm
141-
os_family: linux
142-
arch: arm64
143-
- runner: windows-2019
144-
os_family: windows
145-
arch: amd64
146-
runs-on: ${{ matrix.runner }}
147-
steps:
148-
- name: Checkout repo
149-
uses: actions/checkout@v4
150-
with:
151-
submodules: recursive
152-
ref: ${{ env.INPUT_REF }}
153-
154-
# See comment on temporary tag above. tldr: this is a local tag; never
155-
# gets pushed
156-
- name: Temporary tag
157-
run: git tag "$INPUT_TAG"
158-
159-
- name: Set up Java
160-
if: matrix.os_family != 'Linux'
161-
uses: actions/setup-java@v4
162-
with:
163-
java-version: "21"
164-
distribution: "graalvm"
165-
166-
- name: Set up Gradle
167-
if: matrix.os_family != 'Linux'
168-
uses: gradle/actions/setup-gradle@v4
169-
170-
- name: Build native test server (non-Docker)
171-
if: matrix.os_family != 'Linux'
172-
run: |
173-
./gradlew -PnativeBuild :temporal-test-server:nativeBuild
174-
175-
- name: Build native test server (Docker)
176-
if: matrix.os_family == 'Linux'
177-
run: |
178-
docker run \
179-
--rm -w /github/workspace -v "$(pwd):/github/workspace" \
180-
$(docker build -q ./docker/native-image) \
181-
sh -c "./gradlew -PnativeBuild :temporal-test-server:nativeBuild"
182-
# path ends in a wildcard because on windows the file ends in '.exe'
183-
- name: Upload executable to workflow
184-
uses: actions/upload-artifact@v4
185-
with:
186-
name: ${{ matrix.os_family }}_${{ matrix.arch }}
187-
path: |
188-
temporal-test-server/build/native/nativeCompile/temporal-test-server*
189-
if-no-files-found: error
190-
retention-days: 1
127+
uses: ./.github/workflows/build-native-image.yml
128+
with:
129+
ref: ${{ github.event.inputs.ref }}
191130

192131
attach_to_release:
193132
name: Attach native executables to release

docker/native-image-musl/dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ RUN apt-get install -y git build-essential curl
99
COPY install-musl.sh /opt/install-musl.sh
1010
RUN chmod +x /opt/install-musl.sh
1111
WORKDIR /opt
12+
# We need to build musl and zlibc with musl to for a static build
13+
# See https://www.graalvm.org/21.3/reference-manual/native-image/StaticImages/index.html
1214
RUN ./install-musl.sh
1315
ENV MUSL_HOME=/opt/musl-toolchain
1416
ENV PATH="$MUSL_HOME/bin:$PATH"

docker/native-image/dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV PATH="${JAVA_HOME}/bin:${PATH}"
77
RUN apt-get update && apt-get install -y software-properties-common
88
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
99
RUN apt-get update
10+
# We need to update gcc and g++ to 10 for Graal to work on ARM64
1011
RUN apt-get install -y git build-essential zlib1g-dev gcc-10 g++-10
1112
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10
1213
# Avoid errors like: "fatal: detected dubious ownership in repository"

0 commit comments

Comments
 (0)