Update win.yml #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Windows Package | |
on: [workflow_dispatch, push] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Setup MSBuild and Visual Studio 2022 | |
uses: microsoft/setup-msbuild@v2 | |
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 | |
with: | |
sdk-version: 22621 | |
- name: Get Windows SDK Installation Path | |
run: | | |
$sdkVersion = "10.0.22621.0" # 对应于你的SDK版本 | |
$registryPath = "HKLM:\Software\Microsoft\Windows Kits\Installed Roots" | |
$sdkInstallRoot = (Get-ItemProperty -Path $registryPath).KitsRoot10 | |
if ($sdkInstallRoot) { | |
$sdkPath = Join-Path $sdkInstallRoot $sdkVersion | |
Write-Output "Windows SDK is installed at: $sdkPath" | |
} else { | |
Write-Error "Failed to find Windows SDK installation path." | |
} | |
shell: powershell | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '8' | |
- name: Set JAVA_PATH and JNI Paths | |
run: | | |
echo "JAVA_HOME=$(dirname $(dirname $(which java)))" >> $GITHUB_ENV | |
echo "JNI_INCLUDE_PATH=$JAVA_HOME/include" >> $GITHUB_ENV | |
echo "JNI_INCLUDE_PATH2=$JAVA_HOME/include/win32" >> $GITHUB_ENV | |
echo "JNI_INCLUDE_DIRS=$JAVA_HOME/include;$JAVA_HOME/include/win32" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- name: Checkout submodules | |
run: git submodule update --init | |
- name: Build Package | |
run: . ./buildjar.ps1 | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: dist | |