Skip to content

Commit 336b331

Browse files
committed
ci: split release workflow for arm64 and x86/x64
1 parent 0f51576 commit 336b331

File tree

3 files changed

+104
-3
lines changed

3 files changed

+104
-3
lines changed

.github/workflows/CI.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,20 @@ jobs:
6969
arch:
7070
- x64
7171
- x86
72-
- arm64
7372

7473
uses: ./.github/workflows/release.yaml
7574
if: ${{ github.ref_name == 'release' || startsWith(github.ref, 'refs/tags/') }}
7675
with:
7776
arch: ${{ matrix.arch }}
77+
needs:
78+
- lfs
79+
- lfs-arm64
80+
- lgi
81+
82+
release-arm64:
83+
name: Release arm64
84+
uses: ./.github/workflows/release-arm64.yaml
85+
if: ${{ github.ref_name == 'release' || startsWith(github.ref, 'refs/tags/') }}
7886
needs:
7987
- lfs
8088
- lfs-arm64
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Arch
1+
name: Release (x86, x64)
22

33
on:
44
workflow_call:
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Check arch input
2121
run: |
22-
$allowed_archs = "x86", "x64", "arm64";
22+
$allowed_archs = "x86", "x64";
2323
if (-not ($allowed_archs -contains "${{ inputs.arch }}"))
2424
{
2525
Write-Host "Arch not found";

0 commit comments

Comments
 (0)