mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
ci: Windows arm64 packages #35345
Problem: Neovim binaries are not provided for Windows ARM64. GitHub Actions now offer native CI runners for Windows on ARM devices (windows-11-arm), enabling automated builds and testing. Solution: - Modified CMake packaging to include packaging windows on arm binaries. - Modified env script to install and initialize vs setup for arm64 arch. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:

committed by
Justin M. Keyes

parent
7b099d2b2b
commit
e415fae42e
20
.github/scripts/env.ps1
vendored
20
.github/scripts/env.ps1
vendored
@@ -1,9 +1,17 @@
|
|||||||
# This script enables Developer Command Prompt
|
# This script enables Developer Command Prompt
|
||||||
# See https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
|
# See https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
|
||||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
if ($env:BUILD_ARCH -eq "arm64") {
|
||||||
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
$arch = "arm64"
|
||||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
|
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.arm64 -property installationPath
|
||||||
$name, $value = $_ -split '=', 2
|
} else {
|
||||||
"$name=$value" >> $env:GITHUB_ENV
|
$arch = "x64"
|
||||||
}
|
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($installationPath) {
|
||||||
|
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=$arch -no_logo && set" |
|
||||||
|
ForEach-Object {
|
||||||
|
$name, $value = $_ -split '=', 2
|
||||||
|
"$name=$value" >> $env:GITHUB_ENV
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
@@ -132,27 +132,44 @@ jobs:
|
|||||||
|
|
||||||
windows:
|
windows:
|
||||||
needs: setup
|
needs: setup
|
||||||
runs-on: windows-2022
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- runner: windows-2022
|
||||||
|
arch: x86_64
|
||||||
|
archive_name: nvim-win64
|
||||||
|
- runner: windows-11-arm
|
||||||
|
arch: arm64
|
||||||
|
archive_name: nvim-win-arm64
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Perform a full checkout #13471
|
# Perform a full checkout #13471
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: .github/scripts/env.ps1
|
- run: .github/scripts/env.ps1
|
||||||
|
env:
|
||||||
|
BUILD_ARCH: ${{ matrix.arch }}
|
||||||
|
- name: Install Wix
|
||||||
|
run: |
|
||||||
|
Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" -OutFile "wix314-binaries.zip"
|
||||||
|
Expand-Archive -Path "wix314-binaries.zip" -DestinationPath "C:/wix"
|
||||||
|
echo "C:\wix" >> $env:GITHUB_PATH
|
||||||
- name: Build deps
|
- name: Build deps
|
||||||
run: |
|
run: |
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
||||||
cmake --build .deps
|
cmake --build .deps
|
||||||
- name: build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
||||||
cmake --build build --target package
|
cmake --build build --target package
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nvim-win64
|
name: nvim-win-${{ matrix.arch }}
|
||||||
path: |
|
path: |
|
||||||
build/nvim-win64.msi
|
build/${{ matrix.archive_name }}.zip
|
||||||
build/nvim-win64.zip
|
build/${{ matrix.archive_name }}.msi
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
@@ -200,6 +217,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
||||||
if [ "$TAG_NAME" != "nightly" ]; then
|
if [ "$TAG_NAME" != "nightly" ]; then
|
||||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win64/*
|
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win-x86_64/* nvim-win-arm64/*
|
||||||
fi
|
fi
|
||||||
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win64/*
|
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win-x86_64/* nvim-win-arm64/*
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|ARM64|aarch64)$")
|
||||||
set(CMAKE_SYSTEM_PROCESSOR arm64)
|
set(CMAKE_SYSTEM_PROCESSOR arm64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -27,9 +27,13 @@ set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
|||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "nvim-win-arm64")
|
||||||
|
else()
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CPACK_GENERATOR ZIP WIX)
|
set(CPACK_GENERATOR ZIP WIX)
|
||||||
|
|
||||||
# WIX
|
# WIX
|
||||||
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
||||||
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
||||||
|
Reference in New Issue
Block a user