Skip to content
Merged
Show file tree
Hide file tree
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
68 changes: 56 additions & 12 deletions .github/workflows/build-natives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion OpenRA-Eluant.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<files>
<file src="OpenRA-Eluant.targets" target="build" />
<file src="bin/netstandard2.0/Eluant.*" target="lib/netstandard2.0" />
<file src="native/win/x86/lua51.dll" target="native/win-x86" />
<file src="native/win/x64/lua51.dll" target="native/win-x64" />
<file src="native/win/arm64/lua51.dll" target="native/win-arm64" />
<file src="native/linux/x64/lua51.so" target="native/linux-x64" />
<file src="native/linux/arm64/lua51.so" target="native/linux-arm64" />
<file src="native/osx/x86_64/lua51.dylib" target="native/osx-x64" />
Expand Down
9 changes: 2 additions & 7 deletions OpenRA-Eluant.targets
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x86\lua51.dll" Condition="'$(TargetPlatform)' == 'win-x86'">
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x64\lua51.dll" Condition="'$(TargetPlatform)' == 'win-x64'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lua51.dll</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x64\lua51.dll" Condition="'$(TargetPlatform)' == 'win-x64'">
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-arm64\lua51.dll" Condition="'$(TargetPlatform)' == 'win-arm64'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lua51.dll</Link>
<Visible>false</Visible>
Expand All @@ -31,10 +31,5 @@
<Link>lua51.dylib</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\lib\netstandard2.0\Eluant.dll.config" Condition="'$(TargetPlatform)' != 'win-x64' And '$(TargetPlatform)' != 'win-x86'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>Eluant.dll.config</Link>
<Visible>false</Visible>
</Content>
</ItemGroup>
</Project>
Loading