修复Github Action使用Windows作为运行宿主环境时无法进行GraalVM Native Image编译的问题

很难绷得住
This commit is contained in:
TheWhiteDog9487
2025-12-12 11:47:49 +08:00
parent 0185c2e0d1
commit 7133d39fb3
+10
View File
@@ -42,6 +42,16 @@ jobs:
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: chmod +x ./gradlew run: chmod +x ./gradlew
- name: 构建原生镜像 - name: 构建原生镜像
if: runner.os == 'Windows'
env:
# Needed for Windows; to resolve issue with temp folder during native image build, due to relativization
# problem when different drives are used, such as in GHA runners.
# https://github.com/graalvm/native-build-tools/issues/754
# https://github.com/bric3/jufmt/commit/feb040f159b9a5168d677455218b787d9b644ee2
GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }}
run: ./gradlew nativeCompile -x test
- name: 构建原生镜像
if: runner.os != 'Windows'
run: ./gradlew nativeCompile -x test run: ./gradlew nativeCompile -x test
- name: 上传构建产物 - name: 上传构建产物
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4