From a04379525a964783e947395bd3dcddb5991a998e Mon Sep 17 00:00:00 2001 From: Scott Bilas Date: Tue, 14 Nov 2023 06:15:15 +0100 Subject: [PATCH] Bit of cleanup, also fix checkout for submodule --- .github/workflows/publish.yml | 9 ++++++++- .github/workflows/validate.yml | 21 ++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4785f3c..50e57c6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,13 @@ -name: Publish NuGet package +name: Publish NuGet Package on: workflow_dispatch: push: tags: [ 'release-*' ] +# TODO: trigger on commit desc '/publish' +# TODO: switch to https://github.com/xoofx/dotnet-releaser + jobs: publish: runs-on: windows-latest @@ -21,6 +24,10 @@ jobs: - name: Build for publish run: dotnet publish -c Release + - name: Run tests + run: | + dotnet test --nologo -l:"console;verbosity=normal" -c Release + - name: Publish NuGet package run: | dotnet nuget push publish\Core\*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 26ca80e..faf3d50 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,18 +1,25 @@ -name: Validate dev branch +name: Validate Dev Branch on: push: - # https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions - branches: - - dev + branches: [ 'dev' ] jobs: validate: runs-on: windows-latest + steps: - - uses: actions/checkout@v4.1.1 - - uses: actions/setup-dotnet@v3.2.0 + - name: Checkout + submodules + uses: actions/checkout@v4.1.1 + with: + submodules: true + + - name: Setup .NET + uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '7.0.x' + # https://stackoverflow.com/a/70552262/14582 - - run: dotnet test --nologo -l:"console;verbosity=normal" + - name: Run tests + run: | + dotnet test --nologo -l:"console;verbosity=normal"