(1) Update to use the newest version of the Genova.Scanner package.
#20
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, and Publish to GitHub Packages | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Create nuget.config for GitHub Packages | |
| shell: pwsh | |
| run: | | |
| $lines = @() | |
| $lines += "<?xml version='1.0' encoding='utf-8'?>" | |
| $lines += '<configuration>' | |
| $lines += ' <packageSources>' | |
| $lines += " <add key='github' value='https://nuget.pkg.github.com/$env:GITHUB_REPOSITORY_OWNER/index.json' />" | |
| $lines += " <add key='nuget.org' value='https://api.nuget.org/v3/index.json' />" | |
| $lines += ' </packageSources>' | |
| $lines += ' <packageSourceCredentials>' | |
| $lines += ' <github>' | |
| $lines += " <add key='Username' value='$env:GITHUB_ACTOR' />" | |
| $lines += " <add key='ClearTextPassword' value='$env:SOMENEWKID_PACKAGES_PAT' />" | |
| $lines += ' </github>' | |
| $lines += ' </packageSourceCredentials>' | |
| $lines += '</configuration>' | |
| $lines | Out-File -FilePath "nuget.config" -Encoding utf8 | |
| env: | |
| SOMENEWKID_PACKAGES_PAT: ${{ secrets.SOMENEWKID_PACKAGES_PAT }} | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | |
| - name: Restore dependencies | |
| run: dotnet restore --configfile nuget.config | |
| - name: Build solution | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Generate version string with date/time | |
| id: version | |
| shell: bash | |
| run: | | |
| echo "VERSION=1.0.0-$(date -u +%Y%m%d-%H%M)" >> $GITHUB_ENV | |
| - name: Pack library | |
| run: dotnet pack ./Testing/Testing.csproj --no-build --configuration Release --output ${{ github.workspace }}/nupkg -p:Version=${{ env.VERSION }} | |
| - name: Publish to GitHub Packages | |
| shell: pwsh | |
| run: | | |
| Set-Location "${{ github.workspace }}\nupkg" | |
| dotnet nuget push *.nupkg ` | |
| --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` | |
| --api-key $env:GITHUB_TOKEN | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |