update github action yml to master #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Core Desktop | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Release] | |
runs-on: windows-latest # For a list of available runner types, refer to | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
env: | |
Solution_Name: PKHeX_Raid_Plugin.sln # Replace with your solution name, i.e. MyWpfApp.sln. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Checkout PKHeX.Core | |
uses: actions/checkout@v3 | |
with: | |
repository: kwsch/PKHeX | |
ref: master | |
path: PKHeX | |
- name: Build PKHeX.Core | |
run: | | |
cd PKHeX/PKHeX.Core | |
dotnet restore | |
msbuild PKHeX.Core.csproj /p:Configuration=Release | |
- name: Restore NuGet packages | |
run: dotnet restore | |
- name: Replace latest PKHeX.Core NuGet | |
shell: pwsh | |
run: | | |
$NuGetPackageFolder = Join-Path -Path $env:USERPROFILE -ChildPath ".nuget\packages\pkhex.core" | |
$LatestVersion = (Get-ChildItem $NuGetPackageFolder | Sort-Object -Property LastWriteTime -Descending)[0].Name | |
$PkhexCoreDllSource = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "PKHeX/PKHeX.Core/bin/Release/net8.0/PKHeX.Core.dll" | |
$PkhexCoreDllDest = Join-Path -Path $NuGetPackageFolder -ChildPath "$LatestVersion/lib/net8.0/PKHeX.Core.dll" | |
Copy-Item -Path $PkhexCoreDllSource -Destination $PkhexCoreDllDest | |
# Restore the application to populate the obj folder with RuntimeIdentifiers | |
- name: Restore the application | |
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration | |
env: | |
Configuration: ${{ matrix.configuration }} | |
# Create the app package by building and packaging the Windows Application Packaging project | |
- name: Create the app package | |
run: msbuild $env:Solution_Name /property:Configuration=Release | |
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PKHeX_Raid_Plugin | |
path: | | |
PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/PKHeX.Core.dll | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/PKHeX.Drawing.dll | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/PKHeX.Drawing.PokeSprite.dll | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/libz3.dll | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/PKHeX_Raid_Plugin.deps | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/PKHeX_Raid_Plugin.deps.json | |
!PKHeX_Raid_Plugin/bin/x64/Release/net8.0-windows/PKHeX_Raid_Plugin.pdb |