update workflow to publish to official nuget as well #79
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: Publish | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.1.2 | |
| with: | |
| path: ${{ github.event.repository.name }} | |
| - name: Setup | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Set VERSION variable from tag | |
| run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
| - name: Build `Unmanaged.Core` | |
| run: dotnet build "${{ github.event.repository.name }}/core" -c Debug /p:Version=${VERSION} | |
| - name: Build `Unmanaged.Core` | |
| run: dotnet build "${{ github.event.repository.name }}/core" -c Release /p:Version=${VERSION} | |
| - name: Build `Unmanaged.Generator` | |
| run: dotnet build "${{ github.event.repository.name }}/generator" -c Debug /p:Version=${VERSION} | |
| - name: Build `Unmanaged.Generator` | |
| run: dotnet build "${{ github.event.repository.name }}/generator" -c Release /p:Version=${VERSION} | |
| - name: Build `Unmanaged` | |
| run: dotnet build "${{ github.event.repository.name }}/source" -c Debug /p:Version=${VERSION} | |
| - name: Build `Unmanaged` | |
| run: dotnet build "${{ github.event.repository.name }}/source" -c Release /p:Version=${VERSION} | |
| - name: Build `Unmanaged.Tests` | |
| run: dotnet build "${{ github.event.repository.name }}/tests" -c Debug /p:Version=${VERSION} | |
| - name: Build `Unmanaged.Tests` | |
| run: dotnet build "${{ github.event.repository.name }}/tests" -c Release /p:Version=${VERSION} | |
| - name: Test | |
| run: dotnet test "${{ github.event.repository.name }}/tests" -c Release --logger "trx" | |
| - name: Pack `Unmanaged.Core` | |
| run: dotnet pack "${{ github.event.repository.name }}/core" /p:Version=${VERSION} --no-build --output . | |
| - name: Pack `Unmanaged.Generator` | |
| run: dotnet pack "${{ github.event.repository.name }}/generator" /p:Version=${VERSION} --no-build --output . | |
| - name: Pack `Unmanaged` | |
| run: dotnet pack "${{ github.event.repository.name }}/source" /p:Version=${VERSION} --no-build --output . | |
| - name: Add GitHub source | |
| run: dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --name github --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text | |
| - name: Add official source | |
| run: dotnet nuget add source https://api.nuget.org/v3/index.json --name official | |
| - name: Publish `Unmanaged.Core` to GitHub registry | |
| run: dotnet nuget push SimulationTree.Unmanaged.Core.${VERSION}.nupkg --source github --api-key ${API_KEY} | |
| env: | |
| API_KEY: ${{ secrets.NUGET_TOKEN_GITHUB }} | |
| - name: Publish `Unmanaged.Core` to official registry | |
| run: dotnet nuget push SimulationTree.Unmanaged.Core.${VERSION}.nupkg --source official --api-key ${API_KEY} | |
| env: | |
| API_KEY: ${{ secrets.NUGET_TOKEN_OFFICIAL }} | |
| - name: Publish `Unmanaged.Generator` to GitHub registry | |
| run: dotnet nuget push SimulationTree.Unmanaged.Generator.${VERSION}.nupkg --source github --api-key ${API_KEY} | |
| env: | |
| API_KEY: ${{ secrets.NUGET_TOKEN_GITHUB }} | |
| - name: Publish `Unmanaged.Generator` to official registry | |
| run: dotnet nuget push SimulationTree.Unmanaged.Generator.${VERSION}.nupkg --source official --api-key ${API_KEY} | |
| env: | |
| API_KEY: ${{ secrets.NUGET_TOKEN_OFFICIAL }} | |
| - name: Publish `Unmanaged` to GitHub registry | |
| run: dotnet nuget push SimulationTree.Unmanaged.${VERSION}.nupkg --source github --api-key ${API_KEY} | |
| env: | |
| API_KEY: ${{ secrets.NUGET_TOKEN_GITHUB }} | |
| - name: Publish `Unmanaged` to official registry | |
| run: dotnet nuget push SimulationTree.Unmanaged.${VERSION}.nupkg --source official --api-key ${API_KEY} | |
| env: | |
| API_KEY: ${{ secrets.NUGET_TOKEN_OFFICIAL }}"; |