Add .csproj support - auto-build projects before running tests #13
Workflow file for this run
This file contains hidden or 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: Pack | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| pack: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Test | |
| run: dotnet test Asynkron.TestRunner.sln -c Release --verbosity normal | |
| - name: Pack | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| dotnet pack -c Release -o ./nupkg src/Asynkron.TestRunner/Asynkron.TestRunner.csproj -p:Version="$VERSION" | |
| - name: Publish to NuGet | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| run: dotnet nuget push ./nupkg/*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nupkg | |
| path: ./nupkg/*.nupkg |