Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 42 additions & 18 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,24 @@ jobs:
musl: true
experimental: true
# ---- macOS --------------------------------------------------------
# GitHub retired the Intel (macos-13) hosted runners, so the x86_64
# wheel is cross-built on Apple Silicon: we install an x86_64 GraalVM
# and run native-image under Rosetta 2, which emits an x86_64 binary
# and x86_64 jmods. (GraalVM native-image has no true cross-target.)
- name: macos-x86_64
runs-on: macos-13
runs-on: macos-14
arch: x64
graal_arch: macos-x64
wheel_platform: macosx_11_0_x86_64
macos_target: "11.0"
musl: false
rosetta: true
- name: macos-arm64
runs-on: macos-14
arch: arm64
wheel_platform: macosx_11_0_arm64
macos_target: "11.0"
musl: false
# ---- Windows ------------------------------------------------------
- name: windows-x86_64
runs-on: windows-2022
arch: x64
wheel_platform: win_amd64
musl: false

steps:
- name: Check out code
Expand Down Expand Up @@ -138,20 +138,40 @@ jobs:
echo "JAVA_HOME=/opt/graalvm" >> "$GITHUB_ENV"
echo "/opt/graalvm/bin" >> "$GITHUB_PATH"

- name: Set up GraalVM (macOS / Windows)
if: runner.os != 'Linux'
# Native arm64 GraalVM for the macos-arm64 leg. Skipped for the x86_64
# cross-build, which installs an x86_64 GraalVM by hand below.
- name: Set up GraalVM (macOS arm64)
if: runner.os == 'macOS' && matrix.rosetta != true
uses: graalvm/setup-graalvm@v1
with:
java-version: "21"
distribution: graalvm-community
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
# macOS x86_64 cross-build: Rosetta 2 lets the x86_64 GraalVM (and the
# native-image it drives) run on the Apple Silicon runner.
- name: Install Rosetta 2 (macOS x86_64 cross-build)
if: matrix.rosetta
shell: bash
run: softwareupdate --install-rosetta --agree-to-license

- name: Set up Python (macOS / Windows)
if: runner.os != 'Linux'
- name: Install GraalVM x86_64 (macOS x86_64 cross-build)
if: matrix.rosetta
shell: bash
run: |
set -euo pipefail
url="https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${GRAALVM_VERSION}/graalvm-community-jdk-${GRAALVM_VERSION}_${{ matrix.graal_arch }}_bin.tar.gz"
echo "Downloading $url"
mkdir -p "$RUNNER_TEMP/graalvm"
# macOS tarballs nest the JDK under <top>/Contents/Home; strip the top.
curl -fsSL "$url" | tar -xz -C "$RUNNER_TEMP/graalvm" --strip-components=1
home="$RUNNER_TEMP/graalvm/Contents/Home"
test -x "$home/bin/native-image" || "$home/bin/gu" install native-image || true
echo "JAVA_HOME=$home" >> "$GITHUB_ENV"
echo "$home/bin" >> "$GITHUB_PATH"

- name: Set up Python (macOS)
if: runner.os == 'macOS'
uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand All @@ -169,7 +189,13 @@ jobs:
run: |
set -euo pipefail
chmod +x ./gradlew || true
./gradlew --no-daemon clean nativeCompile
# On the x86_64 leg, run the whole build under Rosetta so the x86_64
# GraalVM (JAVA_HOME) drives native-image and emits an x86_64 binary.
if [ "${{ matrix.rosetta }}" = "true" ]; then
arch -x86_64 ./gradlew --no-daemon clean nativeCompile
else
./gradlew --no-daemon clean nativeCompile
fi

- name: Build wheel
shell: bash
Expand All @@ -183,9 +209,7 @@ jobs:
else
PY=python3
fi
BIN="$PWD/build/native/nativeCompile/codeanalyzer"
[ -f "$BIN" ] || BIN="$PWD/build/native/nativeCompile/codeanalyzer.exe"
export CODEANALYZER_NATIVE_BINARY="$BIN"
export CODEANALYZER_NATIVE_BINARY="$PWD/build/native/nativeCompile/codeanalyzer"
export CODEANALYZER_JMODS_DIR="$JAVA_HOME/jmods"
echo "binary: $CODEANALYZER_NATIVE_BINARY"
echo "jmods: $CODEANALYZER_JMODS_DIR"
Expand Down