Skip to content

Commit 76d57e0

Browse files
authored
Integrate CI for the native windows version (#1314)
* Integrate CI for the native windows version * Rename msys2 to windows * Woops...
1 parent 0e272ab commit 76d57e0

File tree

17 files changed

+84
-162
lines changed

17 files changed

+84
-162
lines changed

.github/workflows/push-continous-delivery.yml

Lines changed: 20 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -65,89 +65,13 @@ jobs:
6565
--cache-to "type=local,dest=/tmp/buildxcache" \
6666
--file ./tools/build/docker/Dockerfile .
6767
68-
exportDockerRootFS:
69-
name: Build and export Docker rootfs for Windows build (WSL2)
70-
runs-on: ubuntu-latest
71-
steps:
72-
- uses: actions/checkout@master
73-
- name: Docker Build and export
74-
run: |
75-
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile .
76-
docker create --name rootfs difegue/lanraragi
77-
docker export --output=package.tar rootfs
78-
- name: Upload rootfs
79-
uses: actions/upload-artifact@v4
80-
with:
81-
name: package
82-
path: package.tar
83-
84-
exportDockerRootFSLegacy:
85-
name: Build and export Docker rootfs for Windows build (WSL1)
86-
runs-on: ubuntu-latest
87-
steps:
88-
- uses: actions/checkout@master
89-
- name: Docker Build and export
90-
run: |
91-
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile-legacy --build-arg INSTALL_PARAMETER=-w .
92-
docker create --name rootfs difegue/lanraragi
93-
docker export --output=package-legacy.tar rootfs
94-
- name: Upload rootfs
95-
uses: actions/upload-artifact@v4
96-
with:
97-
name: package-legacy
98-
path: package-legacy.tar
99-
100-
buildNightlyWSL:
101-
name: Build Nightly Windows Packages
102-
needs:
103-
- exportDockerRootFS
104-
- exportDockerRootFSLegacy
105-
runs-on: windows-latest
106-
steps:
107-
- uses: actions/checkout@master
108-
- name: Download package
109-
uses: actions/download-artifact@v4
110-
with:
111-
name: package
112-
- name: Download package
113-
uses: actions/download-artifact@v4
114-
with:
115-
name: package-legacy
116-
- name: Display structure of downloaded files
117-
run: ls -R
118-
- name: Build MSI Installer
119-
shell: powershell
120-
run: |
121-
[array]$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property installationpath
122-
# Get first line of installPath in case we have multiple VS installs
123-
Import-Module (Join-Path $installPath[0] "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
124-
# Import the VS shell module
125-
Enter-VsDevShell -VsInstallPath $installPath[0] -SkipAutomaticLocation
126-
$ErrorActionPreference = 'Continue'
127-
git submodule init
128-
git submodule update
129-
choco uninstall wixtoolset
130-
choco install wixtoolset --version 3.14.0 --allow-downgrade --force
131-
choco install nuget.commandline
132-
./tools/build/windows/build.ps1
133-
- name: Upload Installer
134-
uses: actions/upload-artifact@v4
135-
with:
136-
name: LANraragi.msi
137-
path: ./tools/build/windows/Karen/LRR_WSL2.msi
138-
if-no-files-found: error
139-
- name: Upload Installer
140-
uses: actions/upload-artifact@v4
141-
with:
142-
name: LANraragi_legacy.msi
143-
path: ./tools/build/windows/Karen/LRR_WSL1.msi
144-
if-no-files-found: error
145-
146-
buildMSYS2:
68+
buildNightlyMSYS2:
14769
name: Build and export native Windows version
14870
runs-on: windows-2025
14971
steps:
150-
- uses: actions/checkout@master
72+
- uses: actions/checkout@v4
73+
with:
74+
submodules: true
15175
- name: Setup MSYS2 UCRT64
15276
uses: msys2/setup-msys2@v2
15377
with:
@@ -156,17 +80,25 @@ jobs:
15680
- name: Install deps
15781
shell: msys2 {0}
15882
run: |
159-
./tools/build/msys2/install-deps.sh
83+
./tools/build/windows/install-deps.sh
16084
- name: Build
16185
shell: msys2 {0}
16286
run: |
163-
./tools/build/msys2/install.sh
164-
./tools/build/msys2/cleanup.sh
165-
./tools/build/msys2/create-dist.sh
87+
./tools/build/windows/install.sh
88+
./tools/build/windows/cleanup.sh
89+
./tools/build/windows/create-dist.sh
16690
- name: Enable UTF-8
167-
run: ./tools/build/msys2/utf8-support.ps1
168-
- name: Upload vfs
91+
run: ./tools/build/windows/utf8-support.ps1
92+
- name: Find MSBuild
93+
uses: microsoft/setup-msbuild@v2
94+
- name: Build MSI Installer
95+
run: |
96+
choco uninstall wixtoolset
97+
choco install wixtoolset --version 3.14.0 --allow-downgrade --force
98+
./tools/build/windows/build-installer.ps1
99+
- name: Upload Installer
169100
uses: actions/upload-artifact@v4
170101
with:
171-
name: windows-native
172-
path: ./win-dist/
102+
name: LANraragi.msi
103+
path: ./tools/build/windows/Karen/Setup/bin/LANraragi.msi
104+
if-no-files-found: error

.github/workflows/release-delivery.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,48 @@ jobs:
1919
with:
2020
name: package
2121
path: package.tar
22-
23-
buildReleaseWSL:
22+
23+
buildReleaseMSYS2:
2424
name: Build Windows Installer
25-
needs: exportDockerRootFS
26-
runs-on: windows-latest
25+
runs-on: windows-2025
2726
steps:
28-
- uses: actions/checkout@master
29-
- name: Download package
30-
uses: actions/download-artifact@v4
27+
- uses: actions/checkout@v4
3128
with:
32-
name: package
29+
submodules: true
30+
- name: Setup MSYS2 UCRT64
31+
uses: msys2/setup-msys2@v2
32+
with:
33+
msystem: UCRT64
34+
update: true
35+
- name: Install deps
36+
shell: msys2 {0}
37+
run: |
38+
./tools/build/windows/install-deps.sh
39+
- name: Build
40+
shell: msys2 {0}
41+
run: |
42+
./tools/build/windows/install.sh
43+
./tools/build/windows/cleanup.sh
44+
./tools/build/windows/create-dist.sh
45+
- name: Enable UTF-8
46+
run: ./tools/build/windows/utf8-support.ps1
47+
- name: Find MSBuild
48+
uses: microsoft/setup-msbuild@v2
3349
- name: Build MSI Installer
34-
shell: powershell
3550
run: |
36-
[array]$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property installationpath
37-
# Get first line of installPath in case we have multiple VS installs
38-
Import-Module (Join-Path $installPath[0] "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
39-
# Import the VS shell module
40-
Enter-VsDevShell -VsInstallPath $installPath[0] -SkipAutomaticLocation
41-
$ErrorActionPreference = 'Continue'
42-
git submodule init
43-
git submodule update
4451
choco uninstall wixtoolset
4552
choco install wixtoolset --version 3.14.0 --allow-downgrade --force
46-
choco install nuget.commandline
47-
./tools/build/windows/build.ps1
53+
./tools/build/windows/build-installer.ps1
4854
- name: Upload Installer
4955
uses: actions/upload-artifact@v4
5056
with:
5157
name: LANraragi.msi
52-
path: ./tools/build/windows/Karen/LRR_WSL2.msi
58+
path: ./tools/build/windows/Karen/Setup/bin/LANraragi.msi
5359
if-no-files-found: error
54-
uploadWSLRelease:
60+
61+
uploadMSYS2Release:
5562
name: Add Windows Installer to release
56-
needs: buildReleaseWSL
63+
needs: buildReleaseMSYS2
5764
runs-on: ubuntu-latest
5865
steps:
5966
- name: Download package
@@ -65,7 +72,7 @@ jobs:
6572
env:
6673
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6774
with:
68-
args: ./LRR_WSL2.msi application/octet-stream
75+
args: ./LANraragi.msi application/octet-stream
6976
- uses: Ilshidur/action-discord@master
7077
env:
7178
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

tools/Documentation/extending-lanraragi/architecture.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,10 @@ root/
120120
|- tools <- Contains scripts for building and installing LRR.
121121
| |- _screenshots <- Screenshots
122122
| |- Documentation <- What you're reading right now
123-
| |- build <- Build tools and scrpits
124-
| |- windows <- Legacy WSL build script
123+
| |- build <- Build tools and scripts
125124
| |- docker <- Dockerfile and configuration files for LRR Docker Container
126125
| |- homebrew <- Script and configuration files for the LRR Homebrew cask
127-
| |- msys2 <- MSYS2 Windows build scripts, patches and submodule link to the Karen WPF Bootstrapper
126+
| |- windows <- MSYS2 Windows build scripts, patches and submodule link to the Karen WPF Bootstrapper
128127
| |- cpanfile <- Perl dependencies description
129128
| |- install.pl <- LANraragi Installer
130129
| +- lanraragi-systemd.service <- Example SystemD service

tools/Documentation/extending-lanraragi/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ You'll also probably want to enable **Debug Mode** in the LRR Options, as that w
2525

2626
The environment for development is **UCRT64**, other have not been tested.
2727

28-
Since Mojolicious and other perl dependencies are not designed to run on Windows they need to be patched. The patches can be found in `tools/build/msys2` alongside other utility scripts.
28+
Since Mojolicious and other perl dependencies are not designed to run on Windows they need to be patched. The patches can be found in `tools/build/windows` alongside other utility scripts.
2929

3030
You need to provide a redis-compatible server.
3131

3232
To setup an environment that can be used for development you need to do the following steps:
3333

3434
1. Update the environment with the `pacman -Syu` command.
3535
2. cd into the LRR directory.
36-
3. Run the script for installing native dependencies `./tools/build/msys2/install-deps.sh`
36+
3. Run the script for installing native dependencies `./tools/build/windows/install-deps.sh`
3737
4. Restart the environment (close and open the shell).
38-
5. Run the script for installing perl dependencies `./tools/build/msys2/install.sh`
38+
5. Run the script for installing perl dependencies `./tools/build/windows/install.sh`
3939

4040
Finally you can launch LRR with the `perl ./script/launcher.pl -d -v ./script/lanraragi` command.
4141

@@ -47,7 +47,7 @@ If you have issues with path names getting mangled you need to patch perl to ena
4747

4848
1. Open a Visual Studio developer console.
4949
2. cd into `<msys install dir>\ucrt64\bin`.
50-
3. Run the `mt.exe -manifest <lrr dir>\tools\build\msys2\perl.exe.manifest "-outputresource:perl.exe;#1"` command.
50+
3. Run the `mt.exe -manifest <lrr dir>\tools\build\windows\perl.exe.manifest "-outputresource:perl.exe;#1"` command.
5151

5252
This will tell perl to use UTF-8 mode and accept any special characters. If you update the environment you might need to patch it again.
5353

tools/build/windows/Karen

Submodule Karen updated 54 files
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# --- LRR Windows build script V2 ---
2+
3+
echo "🎌 Building up LRR Windows Package 🎌"
4+
echo "Inferring version from package.json..."
5+
6+
$json = (Get-Content "package.json" -Raw) | ConvertFrom-Json
7+
$version = $json.version
8+
echo "Version is $version"
9+
$env:LRR_VERSION_NUM=$version
10+
11+
# Copy vfs
12+
Copy-Item -Path "./win-dist" -Destination "./tools/build/windows/Karen/Karen/bin/win-x64/publish/lanraragi" -Recurse -Container
13+
14+
# Build Karen
15+
Set-Location "./tools/build/windows/Karen"
16+
dotnet publish --nologo -r win-x64 -o Karen\bin\win-x64\publish Karen\Karen.csproj
17+
18+
# Build Setup
19+
MSBuild -nologo -v:minimal /p:RestorePackagesConfig=true /t:Restore
20+
MSBuild Setup\Setup.csproj -nologo -v:minimal /p:Configuration=Release /p:Platform=AnyCPU
21+
22+
Get-FileHash "./Setup/bin/LANraragi.msi" | Format-List

tools/build/windows/build.ps1

Lines changed: 0 additions & 38 deletions
This file was deleted.
File renamed without changes.

tools/build/msys2/create-dist.sh renamed to tools/build/windows/create-dist.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ cp -R ./script ./win-dist
4646
cp -R ./templates ./win-dist
4747
cp -R ./locales ./win-dist
4848

49-
cp ./tools/build/msys2/run.ps1 ./win-dist
49+
cp ./tools/build/windows/run.ps1 ./win-dist
5050

51-
cp ./tools/build/msys2/redis.conf ./win-dist/runtime/redis
51+
cp ./tools/build/windows/redis.conf ./win-dist/runtime/redis
File renamed without changes.

0 commit comments

Comments
 (0)