Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
108 changes: 79 additions & 29 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ on:
branches: [ "main" ]

env:
DOTNET_VERSION: '9.0.304'
DOTNET_VERSION: '10.0.101'
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
NEXUSMOD_API_KEY: ${{ secrets.NEXUSMOD_API_KEY }}
NEXUSMOD_SESSION_COOKIE: ${{ secrets.NEXUSMOD_SESSION_COOKIE }}

jobs:
build:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
Expand All @@ -37,18 +37,24 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.dotnet
key: ${{ runner.os }}-dotnet
restore-keys: |
${{ runner.os }}-dotnet
key: ${{ runner.os }}-dotnet-${{ env.DOTNET_VERSION }}

- name: NuGet cache
id: cache-nuget
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
path: |
${{ github.workspace }}/.nuget/packages
${{ github.workspace }}/packages
${{ github.workspace }}/PromptPlus/**/obj
${{ github.workspace }}/WitchyBND/**/obj
${{ github.workspace }}/WitchyBND.Shell/**/obj
${{ github.workspace }}/WitchyFormats/**/obj
${{ github.workspace }}/WitchyLib/**/obj
${{ github.workspace }}/WitchyTests/**/obj
${{ github.workspace }}/SoulsFormats/**/obj
${{ github.workspace }}/SoulsOodleLib/**/obj
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.win-x64.lock.json') }}

- name: Setup .NET
if: ${{ steps.cache-dotnet-core.outputs.cache-hit != 'true' }}
Expand All @@ -58,34 +64,78 @@ jobs:

- name: Restore packages
if: ${{ steps.cache-nuget.outputs.cache-hit != 'true' }}
run: nuget restore ./WitchyBND.sln -LockedMode

run: dotnet restore -r win-x64 --locked-mode ./WitchyBND.sln --lock-file-path packages.win-x64.lock.json
- name: Build
run: dotnet build -c Release --no-restore ./WitchyTests/WitchyTests.csproj # Builds WitchyBND which builds Shell
run: dotnet build -r win-x64 -c Release --no-restore WitchyTests # Builds WitchyTests which builds WitchyBND which builds WitchyBND.Shell

- name: Run unit tests
run: dotnet test -c Release -r win-x64 --no-build --filter TestCategory!=SkipOnGitHubAction

- name: Publish application
run: dotnet publish -r win-x64 -c Release --no-build WitchyBND

# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: 'WitchyBND-SHA${{ github.sha }}-win-x64'
path: './bin/publish/win-x64'

- name: Install test runner
run: nuget install NUnit.ConsoleRunner -Version 3.17.0 -DirectDownload -OutputDirectory .
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Dotnet cache
id: cache-dotnet-core
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.dotnet
key: ${{ runner.os }}-dotnet-${{ env.DOTNET_VERSION }}

- name: NuGet cache
id: cache-nuget
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.nuget/packages
${{ github.workspace }}/packages
${{ github.workspace }}/PromptPlus/**/obj
${{ github.workspace }}/WitchyBND/**/obj
${{ github.workspace }}/WitchyBND.Shell/**/obj
${{ github.workspace }}/WitchyFormats/**/obj
${{ github.workspace }}/WitchyLib/**/obj
${{ github.workspace }}/WitchyTests/**/obj
${{ github.workspace }}/SoulsFormats/**/obj
${{ github.workspace }}/SoulsOodleLib/**/obj
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.linux-x64.lock.json') }}

- name: Setup .NET
if: ${{ steps.cache-dotnet-core.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore packages
if: ${{ steps.cache-nuget.outputs.cache-hit != 'true' }}
run: dotnet restore -r linux-x64 --locked-mode ./WitchyBND.sln --lock-file-path packages.linux-x64.lock.json

- name: Build
run: dotnet build -c Release -r linux-x64 --no-restore WitchyTests # Builds WitchyTests which builds WitchyBND which builds WitchyBND.Shell

- name: Run unit tests
run: ./NUnit.ConsoleRunner.3.17.0/tools/nunit3-console.exe ./WitchyTests/bin/Release/net8.0-windows/WitchyTests.dll --where "cat != SkipOnGitHubAction"
run: dotnet test -c Release -r linux-x64 --no-build --filter TestCategory!=SkipOnGitHubAction

- name: Publish application
run: |
cd WitchyBND
dotnet publish -c Release --no-restore
run: dotnet publish -c Release -r linux-x64 --no-build WitchyBND

# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: 'WitchyBND-SHA${{ github.sha }}'
path: './bin/publish'

# nexus:
# runs-on: windows-latest
# steps:
# - name: Setup mod uploader
# run: dotnet tool install -g Digitalroot.ModUploader
#
# - name: Check mod uploader
# run: drmu nx check
name: 'WitchyBND-SHA${{ github.sha }}-linux-x64'
path: './bin/publish/linux-x64'
Loading