From 53400767231285837c657a04b2093ceaab068308 Mon Sep 17 00:00:00 2001 From: Noxalus Date: Sat, 6 Jul 2024 14:52:37 +0200 Subject: [PATCH] Update the CI to build Linux version of the patch. --- .github/workflows/dotnet-desktop.yml | 24 ++++++++++++------ CI/CreateArtifact.cmd | 37 +++++++++++++++++++++------- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 7d965b5..fae1384 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -1,7 +1,7 @@ name: GitHub Release on: push: - branches: [ ci ] + branches: [ ci, avalonia ] tags: - 'v*.*' jobs: @@ -24,22 +24,32 @@ jobs: with: proj-path: KHFM-VF-Patch/KHFM-VF-Patch.csproj - - name: Build Binary + - name: Build for Windows (x86) shell: cmd - run: call .\CI\Build.cmd + run: dotnet publish KHFM-VF-Patch/KHFM-VF-Patch.sln /p:PublishReadyToRun=true --self-contained --runtime win-x86 - - name: Create Artifact + - name: Build for Linux (x64) + shell: cmd + run: dotnet publish KHFM-VF-Patch/KHFM-VF-Patch.sln /p:PublishReadyToRun=true --self-contained --runtime linux-x64 + + - name: Create Artifacts shell: cmd run: call .\CI\CreateArtifact.cmd - - name: Rename Artifact with project version + - name: Rename Windows Artifact with project version + shell: cmd + run: mv ./KHFM-VF-Patch/KHFM-VF-Patch-Windows.zip ./KHFM-VF-Patch/KHFM-VF-Patch-Windows-${{ steps.get-version.outputs.version }}.zip + + - name: Rename Linux Artifact with project version shell: cmd - run: mv ./KHFM-VF-Patch/KHFM-VF-Patch.zip ./KHFM-VF-Patch/KHFM-VF-Patch-${{ steps.get-version.outputs.version }}.zip + run: mv ./KHFM-VF-Patch/KHFM-VF-Patch-Linux.zip ./KHFM-VF-Patch/KHFM-VF-Patch-Linux-${{ steps.get-version.outputs.version }}.zip - name: Create Release id: create_release uses: softprops/action-gh-release@v2 with: - files: ./KHFM-VF-Patch/KHFM-VF-Patch-${{ steps.get-version.outputs.version }}.zip + files: + -./KHFM-VF-Patch/KHFM-VF-Patch-Windows-${{ steps.get-version.outputs.version }}.zip + -./KHFM-VF-Patch/KHFM-VF-Patch-Linux-${{ steps.get-version.outputs.version }}.zip draft: true prerelease: true diff --git a/CI/CreateArtifact.cmd b/CI/CreateArtifact.cmd index 93654dd..00e3ca0 100644 --- a/CI/CreateArtifact.cmd +++ b/CI/CreateArtifact.cmd @@ -3,19 +3,38 @@ pushd "%~dp0" cd ..\KHFM-VF-Patch -@REM Create Patches directory -powershell New-Item -Path "bin\x86\Release\net8.0-windows7.0\Resources\Patches" -ItemType Directory +@REM Create Patches directory that will be copy in the artifacts +powershell New-Item -Path "Patches" -ItemType Directory @REM Zip all sub-patches in the proper directory with the proper extension -powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-EN" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Magic-EN.patch" -Format Zip -powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-FR" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Magic-FR.patch" -Format Zip -powershell Compress-7Zip "Resources\Patches\KH1FM-Stranger" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Stranger.patch" -Format Zip -powershell Compress-7Zip "Resources\Patches\KH1FM-Textures" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Textures.patch" -Format Zip -powershell Compress-7Zip "Resources\Patches\KH1FM-Voices" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Voices.patch" -Format Zip -powershell Compress-7Zip "Resources\Patches\KH1FM-Videos" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Videos.patch" -Format Zip +powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-EN" -ArchiveFileName "Patches\KH1FM-Magic-EN.patch" -Format Zip +powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-FR" -ArchiveFileName "Patches\KH1FM-Magic-FR.patch" -Format Zip +powershell Compress-7Zip "Resources\Patches\KH1FM-Stranger" -ArchiveFileName "Patches\KH1FM-Stranger.patch" -Format Zip +powershell Compress-7Zip "Resources\Patches\KH1FM-Textures" -ArchiveFileName "Patches\KH1FM-Textures.patch" -Format Zip +powershell Compress-7Zip "Resources\Patches\KH1FM-Voices" -ArchiveFileName "Patches\KH1FM-Voices.patch" -Format Zip +powershell Compress-7Zip "Resources\Patches\KH1FM-Videos" -ArchiveFileName "Patches\KH1FM-Videos.patch" -Format Zip + +@REM ** Windows Platform ** + +@REM Create Patches directory for Windows +powershell New-Item -Path "bin\Release\net8.0\win-x86\publish\Resources\Patches" -ItemType Directory + +@REM Copy Patches directory +powershell Copy-Item -Path "Patches" -Destination "bin\Release\net8.0\win-x86\publish\Resources\Patches" -Recurse + +@REM Zip all patch files to upload them for release +powershell Compress-7Zip "bin\Release\net8.0\win-x86\publish" -ArchiveFileName "KHFM-VF-Patch-Windows.zip" -Format Zip + +@REM ** Linux Platform ** + +@REM Create Patches directory for Linux +powershell New-Item -Path "bin\Release\net8.0\linux-x64\publish\Resources\Patches" -ItemType Directory + +@REM Copy Patches directory +powershell Copy-Item -Path "Patches" -Destination "bin\Release\net8.0\linux-x64\publish\Resources\Patches" -Recurse @REM Zip all patch files to upload them for release -powershell Compress-7Zip "bin\x86\Release\net8.0-windows7.0" -ArchiveFileName "KHFM-VF-Patch.zip" -Format Zip +powershell Compress-7Zip "bin\Release\net8.0\linux-x64\publish" -ArchiveFileName "KHFM-VF-Patch-Linux.zip" -Format Zip :exit popd