Update GitHub Actions workflows

This commit is contained in:
genteure 2022-05-26 23:11:37 +08:00
parent bb8e23ab4d
commit 2baea18afd
3 changed files with 52 additions and 24 deletions

View File

@ -12,7 +12,6 @@ env:
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
strategy:
matrix:
@ -23,61 +22,87 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v2
- name: Restore Packages
run: dotnet restore -v m --disable-parallel
- name: Run Tests
run: dotnet test -v m
- name: Run Tests - Debug
run: dotnet test -v m -c Debug
- name: Run Tests - Release
run: dotnet test -v m -c Release
build_wpf:
needs: test
strategy:
matrix:
build_configuration: [Debug, Release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Restore Packages
run: nuget restore -Verbosity quiet
- name: Build WPF
run: msbuild /nologo /v:m /p:Configuration="${{ matrix.build_configuration }}"
- name: Upload Artifacts
- name: Build WPF - Debug
run: msbuild /nologo /v:m /p:Configuration="Debug"
- name: Build WPF - Release
run: msbuild /nologo /v:m /p:Configuration="Release"
- name: Upload Artifacts - Debug
uses: actions/upload-artifact@v2
with:
name: WPF-${{ matrix.build_configuration }}
path: BililiveRecorder.WPF/bin/${{ matrix.build_configuration }}
name: WPF-Debug
path: BililiveRecorder.WPF/bin/Debug
- name: Upload Artifacts - Release
uses: actions/upload-artifact@v2
with:
name: WPF-Release
path: BililiveRecorder.WPF/bin/Release
build_cli:
needs: test
strategy:
matrix:
rid: [any, linux-arm, linux-arm64, linux-x64, osx-x64, win-x64]
build_configuration: [Debug, Release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v2
- name: Restore Packages
run: dotnet restore -v m --disable-parallel
- name: Build CLI
- name: Build CLI - Debug
if: ${{ matrix.rid == 'any' }}
run: dotnet publish -c ${{ matrix.build_configuration }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
- name: Build CLI
run: dotnet publish -c Debug BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
- name: Build CLI - Release
if: ${{ matrix.rid == 'any' }}
run: dotnet publish -c Release BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
- name: Build CLI - Debug
if: ${{ matrix.rid != 'any' }}
run: dotnet publish -c ${{ matrix.build_configuration }} -r ${{ matrix.rid }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
- name: Upload Artifacts
run: dotnet publish -c Debug -r ${{ matrix.rid }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
- name: Build CLI - Release
if: ${{ matrix.rid != 'any' }}
run: dotnet publish -c Release -r ${{ matrix.rid }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
- name: Upload Artifacts - Debug
uses: actions/upload-artifact@v2
with:
name: CLI-${{ matrix.rid }}-${{ matrix.build_configuration }}
path: BililiveRecorder.Cli/publish/${{ matrix.rid }}
name: CLI-${{ matrix.rid }}-Debug
path: BililiveRecorder.Cli/publish/${{ matrix.rid }}/Debug
- name: Upload Artifacts - Release
uses: actions/upload-artifact@v2
with:
name: CLI-${{ matrix.rid }}-Release
path: BililiveRecorder.Cli/publish/${{ matrix.rid }}/Release
build_docker:
needs: test

View File

@ -11,7 +11,6 @@ env:
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
strategy:
matrix:
@ -22,11 +21,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v2
- name: Restore Packages
run: dotnet restore -v m --disable-parallel
- name: Run Tests
run: dotnet test -v m
- name: Run Tests - Debug
run: dotnet test -v m -c Debug
- name: Run Tests - Release
run: dotnet test -v m -c Release
release_wpf:
needs: test

View File

@ -7,8 +7,8 @@
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
<RuntimeIdentifiers>win-x64;osx-x64;osx.10.11-x64;linux-arm64;linux-arm;linux-x64</RuntimeIdentifiers>
<RuntimeIdentifier Condition=" '$(RuntimeIdentifier)' == 'any' "></RuntimeIdentifier>
<PublishDir Condition=" '$(RuntimeIdentifier)' == '' ">publish\any</PublishDir>
<PublishDir Condition=" '$(RuntimeIdentifier)' != '' ">publish\$(RuntimeIdentifier)</PublishDir>
<PublishDir Condition=" '$(RuntimeIdentifier)' == '' ">publish\any\$(Configuration)</PublishDir>
<PublishDir Condition=" '$(RuntimeIdentifier)' != '' ">publish\$(RuntimeIdentifier)\$(Configuration)</PublishDir>
<SelfContained Condition=" '$(RuntimeIdentifier)' == '' ">false</SelfContained>
<SelfContained Condition=" '$(SelfContained)' == '' ">true</SelfContained>
</PropertyGroup>