1+ name : Release (ARM64)
2+
3+ on :
4+ workflow_call :
5+
6+ env :
7+ LUAINSTALLER_VERSION : 0.6.0.0
8+
9+ jobs :
10+ release :
11+ runs-on : windows-latest
12+ name : Release
13+
14+ steps :
15+
16+ - name : Checkout LuaInstaller
17+ uses : actions/checkout@v4
18+ with :
19+ path : LuaInstaller
20+
21+ - name : Set environment variables
22+ run : |
23+ $wpf_dir = Join-Path "${{ runner.temp }}" -ChildPath LuaInstaller.EndUsers;
24+ $console_dir = Join-Path "${{ runner.temp }}" -ChildPath LuaInstaller.Console;
25+
26+ Add-Content "${{ github.env }}" "WPF_DIR=${wpf_dir}";
27+ Add-Content "${{ github.env }}" "CONSOLE_DIR=${console_dir}";
28+
29+ - name : Setup dotnet
30+ run : |
31+ $dotnet_dir = Join-Path -Path "${{ runner.temp }}" -ChildPath "dotnet-dir";
32+
33+ New-Item $dotnet_dir -ItemType Directory;
34+
35+ $dotnet_install_file = Join-Path -Path $dotnet_dir -ChildPath "dotnet-install.ps1";
36+ $dotnet_runner = Join-Path -Path $dotnet_dir -ChildPath "dotnet";
37+
38+ Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile $dotnet_install_file;
39+ & $dotnet_install_file -Architecture "arm64" -Version "6.0.427" -InstallDir $dotnet_dir;
40+
41+ Add-Content "${{ github.env }}" "DOTNET_RUNNER=${dotnet_runner}";
42+
43+ - name : Restore the solution
44+ run : |
45+ & "${{ env.DOTNET_RUNNER }}" `
46+ restore LuaInstaller\LuaInstaller.sln
47+
48+ - name : Build LuaInstaller.Console
49+ run : |
50+ & "${{ env.DOTNET_RUNNER }}" `
51+ publish LuaInstaller\LuaInstaller.Console\LuaInstaller.Console.csproj `
52+ -o "${{ env.CONSOLE_DIR }}" `
53+ -c Release `
54+ -r win-arm64 `
55+ --self-contained true
56+
57+ - name : Build LuaInstaller
58+ run : |
59+ & "${{ env.DOTNET_RUNNER }}" `
60+ publish LuaInstaller\LuaInstaller\LuaInstaller.csproj `
61+ -o "${{ env.WPF_DIR }}" `
62+ -c Release `
63+ -r win-arm64 `
64+ --self-contained true
65+
66+ - name : Prepare artifacts to upload
67+ run : |
68+ mkdir release;
69+ $dirs_to_archive = "${{ env.CONSOLE_DIR }}", "${{ env.WPF_DIR }}";
70+
71+ foreach ($dir in $dirs_to_archive)
72+ {
73+ $archive_name = (Get-Item $dir | Select-Object -ExpandProperty Name) + "-v${{ env.LUAINSTALLER_VERSION }}-arm64.zip";
74+ $archive_path = Join-Path -Path "release" -ChildPath $archive_name;
75+
76+ Compress-Archive -Path $dir -DestinationPath $archive_path;
77+
78+ $current_file_sha256_hash = Get-FileHash $archive_path -Algorithm SHA256 | Select-Object -ExpandProperty Hash;
79+ $current_file_md5_hash = Get-FileHash $archive_path -Algorithm MD5 | Select-Object -ExpandProperty Hash;
80+ $current_file_sha256_file = Join-Path -Path "release" -ChildPath ($archive_name + "-SHA256.txt");
81+ $current_file_md5_file = Join-Path -Path "release" -ChildPath ($archive_name + "-MD5.txt");
82+ Set-Content -Path $current_file_sha256_file -Value $current_file_sha256_hash -NoNewline;
83+ Set-Content -Path $current_file_md5_file -Value $current_file_md5_hash -NoNewline;
84+ }
85+
86+ - name : Upload artifacts
87+ uses : actions/upload-artifact@v4
88+ with :
89+ name : release-v${{ env.LUAINSTALLER_VERSION }}-arm64
90+ path : release
91+ retention-days : 1
92+ if-no-files-found : error
93+
0 commit comments