diff --git a/.github/workflows/build-natives.yml b/.github/workflows/build-natives.yml index 8e6eb8f..313765b 100644 --- a/.github/workflows/build-natives.yml +++ b/.github/workflows/build-natives.yml @@ -13,24 +13,31 @@ permissions: jobs: windows: - name: Windows (x86 + x64) - runs-on: ubuntu-22.04 + name: Windows (x64) + runs-on: windows-2022 steps: - name: Setup Dependencies run: | - mkdir -p artifacts/x86 - mkdir artifacts/x64 - sudo apt-get install mingw-w64 + New-Item -ItemType Directory -Force artifacts/x64 | Out-Null + + - name: Download sources + shell: pwsh + run: | + $version = ${env:LUA_VERSION} + $archive = "lua-${env:LUA_VERSION}.tar.gz" + $url = "https://www.lua.org/ftp/$archive" + Invoke-WebRequest -Uri $url -OutFile $archive + tar xf $archive - name: Compile natives + shell: pwsh run: | - curl -s -L -O https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz - tar xf lua-${LUA_VERSION}.tar.gz - cd lua-${LUA_VERSION}/src/ - make mingw CC=i686-w64-mingw32-gcc - cp lua51.dll ../../artifacts/x86/ - make clean - make mingw CC=x86_64-w64-mingw32-gcc + $VsInstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + Import-Module "$VsInstallPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -Scope Local + Enter-VsDevShell -VsInstallPath $VsInstallPath -Arch amd64 >$null + cd lua-${env:LUA_VERSION}/src/ + cl -MD -O2 -c -DLUA_BUILD_AS_DLL *.c + link -DLL -IMPLIB:lua51.lib -OUT:lua51.dll (Get-ChildItem -Path *.obj -Exclude lua.obj,luac.obj) cp lua51.dll ../../artifacts/x64/ - name: Upload Artifacts @@ -39,6 +46,43 @@ jobs: name: Natives-Windows path: ./artifacts + windows-arm64: + name: Windows (arm64) + runs-on: windows-11-arm + steps: + - name: Clone repository + uses: actions/checkout@v7 + + - name: Setup Dependencies + run: | + New-Item -ItemType Directory -Force artifacts/arm64 | Out-Null + + - name: Download sources + shell: pwsh + run: | + $version = ${env:LUA_VERSION} + $archive = "lua-${env:LUA_VERSION}.tar.gz" + $url = "https://www.lua.org/ftp/$archive" + Invoke-WebRequest -Uri $url -OutFile $archive + tar xf $archive + + - name: Compile natives + shell: pwsh + run: | + $VsInstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + Import-Module "$VsInstallPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" -Scope Local + Enter-VsDevShell -VsInstallPath $VsInstallPath -Arch arm64 >$null + cd lua-${env:LUA_VERSION}/src/ + cl -MD -O2 -c -DLUA_BUILD_AS_DLL *.c + link -DLL -IMPLIB:lua51.lib -OUT:lua51.dll (Get-ChildItem -Path *.obj -Exclude lua.obj,luac.obj) + cp lua51.dll ../../artifacts/arm64/ + + - name: Upload Artifacts + uses: actions/upload-artifact@v7 + with: + name: Natives-Windows(arm64) + path: ./artifacts + macos: name: macOS (x64 + arm64) runs-on: macos-14 diff --git a/.github/workflows/build-nuget.yml b/.github/workflows/build-nuget.yml index 7318650..a35ab2e 100644 --- a/.github/workflows/build-nuget.yml +++ b/.github/workflows/build-nuget.yml @@ -57,6 +57,12 @@ jobs: name: Natives-Windows path: ./native/win + - name: Download artifacts - native - Windows (arm64) + uses: actions/download-artifact@v8 + with: + name: Natives-Windows(arm64) + path: ./native/win + - name: Download artifacts - native - MacOS uses: actions/download-artifact@v8 with: diff --git a/OpenRA-Eluant.nuspec b/OpenRA-Eluant.nuspec index b5a4c9d..01bd88b 100644 --- a/OpenRA-Eluant.nuspec +++ b/OpenRA-Eluant.nuspec @@ -26,8 +26,8 @@ - + diff --git a/OpenRA-Eluant.targets b/OpenRA-Eluant.targets index 1060882..101c118 100644 --- a/OpenRA-Eluant.targets +++ b/OpenRA-Eluant.targets @@ -1,12 +1,12 @@  - + PreserveNewest lua51.dll false - + PreserveNewest lua51.dll false @@ -31,10 +31,5 @@ lua51.dylib false - - PreserveNewest - Eluant.dll.config - false -