Skip to content

Commit

Permalink
Dual-build legacy/wsl2 windows installers
Browse files Browse the repository at this point in the history
  • Loading branch information
Difegue committed Apr 12, 2024
1 parent c0ae65f commit 344156d
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 22 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/push-continous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
--file ./tools/build/docker/Dockerfile .
exportDockerRootFS:
name: Build and export Docker rootfs for Windows build
name: Build and export Docker rootfs for Windows build (WSL2)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker Build and export
run: |
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile --build-arg INSTALL_PARAMETER=-w .
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile .
docker create --name rootfs difegue/lanraragi
docker export --output=package.tar rootfs
- name: Upload rootfs
Expand All @@ -53,8 +53,24 @@ jobs:
name: package
path: package.tar

exportDockerRootFSLegacy:
name: Build and export Docker rootfs for Windows build (WSL1)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker Build and export
run: |
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile-legacy --build-arg INSTALL_PARAMETER=-w .
docker create --name rootfs difegue/lanraragi
docker export --output=package.tar rootfs
- name: Upload rootfs
uses: actions/upload-artifact@v1
with:
name: package-legacy
path: package.tar

buildNightlyWSL:
name: Build Nightly Windows Package
name: Build Nightly Windows Packages
needs: exportDockerRootFS
runs-on: windows-latest
steps:
Expand All @@ -63,6 +79,10 @@ jobs:
uses: actions/download-artifact@v1
with:
name: package
- name: Download package
uses: actions/download-artifact@v1
with:
name: package-legacy
- name: Build MSI Installer
shell: powershell
run: |
Expand All @@ -80,4 +100,9 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: LANraragi.msi
path: ./tools/build/windows/Karen/Setup/bin/LANraragi.msi
path: ./tools/build/windows/Karen/LRR_WSL2.msi
- name: Upload Installer
uses: actions/upload-artifact@v1
with:
name: LANraragi_legacy.msi
path: ./tools/build/windows/Karen/LRR_WSL1.msi
2 changes: 1 addition & 1 deletion tools/build/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DOCKER-VERSION 0.3.4
FROM alpine:3.18
FROM alpine:3.19.1
LABEL git="https://github.com/Difegue/LANraragi"
ARG INSTALL_PARAMETER

Expand Down
2 changes: 1 addition & 1 deletion tools/build/docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DOCKER-VERSION 0.3.4
FROM alpine:3.18
FROM alpine:3.19.1

#Default mojo server port
EXPOSE 3000
Expand Down
3 changes: 2 additions & 1 deletion tools/build/docker/Dockerfile-legacy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# DOCKER-VERSION 0.3.4
FROM alpine:3.12.12
LABEL git="https://github.com/Difegue/LANraragi"
ARG INSTALL_PARAMETER

ENV S6_KEEP_ENV 1

Expand Down Expand Up @@ -56,7 +57,7 @@ COPY --chown=koyomi:koyomi /package.json package.json
COPY --chown=koyomi:koyomi /package-lock.json package-lock.json

# Run the install script as root
RUN sh ./tools/install-everything.sh
RUN sh ./tools/install-everything.sh $INSTALL_PARAMETER

#Copy remaining LRR files from context
COPY --chown=koyomi:koyomi /lib lib
Expand Down
13 changes: 11 additions & 2 deletions tools/build/docker/install-everything.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ apk add perl perl-io-socket-ssl perl-dev redis libarchive-dev libbz2 openssl-dev
apk add imagemagick imagemagick-perlmagick libwebp-tools libheif
apk add g++ make pkgconf gnupg wget curl file
apk add shadow s6 s6-portable-utils
apk add nodejs npm s6-overlay libjxl

# Check for alpine version
if [ -f /etc/alpine-release ]; then
alpine_version=$(cat /etc/alpine-release)
if [ "$alpine_version" = "3.12.12" ]; then
apk add nodejs-npm
else # Those packages don't exist on 3.12
apk add nodejs npm s6-overlay libjxl
fi
fi

# Install cpanm
curl -L https://cpanmin.us | perl - App::cpanminus

# Check for windows to install specific versions of packages
# Check for WSL1 to install specific versions of packages
if [ $WSL -eq 1 ]; then
# Install Linux::Inotify 2.2 explicitly as 2.3 doesn't work properly on WSL:
# WSL2 literally doesn't work for any form of filewatching,
Expand Down
25 changes: 13 additions & 12 deletions tools/build/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ $env:LRR_VERSION_NUM=$version
# Use Docker image
mv .\package\package.tar .\tools\build\windows\Karen\External\package.tar

# Download and unpack Redis
cd .\tools\build\windows\Karen\External
Invoke-WebRequest -Uri https://github.com/redis-windows/redis-windows/releases/download/7.0.14/Redis-7.0.14-Windows-x64.tar.gz -OutFile .\redis.tar.gz
tar -xzf .\redis.tar.gz
rm .\redis.tar.gz
mv .\Redis-7.0.14-Windows-x64 .\Redis

# Copy redis.conf to redis folder
cp ..\..\..\docker\redis.conf .\Redis\redis.conf

# Use Karen master
cd ..
cd .\tools\build\windows\Karen
echo (Resolve-Path .\).Path
nuget restore

# Build Karen and Setup
msbuild /p:Configuration=Release

Get-FileHash .\Setup\bin\LANraragi.msi | Format-List
Get-FileHash .\Setup\bin\LANraragi.msi | Format-List

mv .\Setup\bin\LANraragi.msi .\LRR_WSL2.msi

# Do it again for legacy image
cd ..\..\..\..
mv .\package-legacy\package.tar .\tools\build\windows\Karen\External\package.tar
cd .\tools\build\windows\Karen
msbuild /p:Configuration=Release /p:DefineConstants=WSL1_LEGACY

Get-FileHash .\Setup\bin\LANraragi.msi | Format-List
mv .\Setup\bin\LANraragi.msi .\LRR_WSL1.msi

0 comments on commit 344156d

Please sign in to comment.