fix Directory.Packages.props #2
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: Build, Test, Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| defaults: | |
| run: | |
| working-directory: src | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Decrypt signing key | |
| run: | | |
| openssl aes-256-cbc -d -pbkdf2 \ | |
| -in key_private.snk.enc \ | |
| -out key_private.snk \ | |
| -pass pass:${{ secrets.STRONG_NAME_PASSWORD }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build and sign (trusted release) | |
| run: dotnet build -c Release --no-restore \ | |
| /p:SignAssembly=true \ | |
| /p:PublicSign=false \ | |
| /p:AssemblyOriginatorKeyFile=key_private.snk | |
| - name: Run Tests | |
| run: dotnet test -c Release --no-restore --no-build -v normal | |
| - name: Pack NuGet Package(s) | |
| run: dotnet pack -c Release --no-restore --no-build --output ~/nuget-packages | |
| - name: Upload Build Artifact(s) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: ~/nuget-packages | |
| - name: Push NuGet Package(s) | |
| run: dotnet nuget push ~/nuget-packages/*.nupkg \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --api-key ${{ secrets.NUGET_API_KEY }} \ | |
| --skip-duplicate |