Skip to content

Commit

Permalink
Update the CI to build Linux version of the patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Noxalus committed Jul 6, 2024
1 parent b49e6c1 commit a7f79f6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 16 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: GitHub Release
on:
push:
branches: [ ci ]
branches: [ ci, avalonia ]
tags:
- 'v*.*'
jobs:
Expand All @@ -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 /p:PublishReadyToRun=true --self-contained --runtime win-x86

- name: Create Artifact
- name: Build for Linux (x64)
shell: cmd
run: dotnet publish /p:PublishReadyToRun=true --self-contained --runtime lin-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-Win.zip ./KHFM-VF-Patch/KHFM-VF-Patch-Win-${{ 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-Lin.zip ./KHFM-VF-Patch/KHFM-VF-Patch-${{ 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-Win-${{ steps.get-version.outputs.version }}.zip
-./KHFM-VF-Patch/KHFM-VF-Patch-Lin-${{ steps.get-version.outputs.version }}.zip
draft: true
prerelease: true
37 changes: 28 additions & 9 deletions CI/CreateArtifact.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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-Win.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-Lin.zip" -Format Zip

:exit
popd
Expand Down

0 comments on commit a7f79f6

Please sign in to comment.