Publish to NuGet #7
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 to NuGet | |
| on: | |
| workflow_dispatch: | |
| env: | |
| DOTNET_TARGET: 'net10.0' | |
| jobs: | |
| build--pack-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # enable GitHub OIDC token | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: src | |
| sparse-checkout-cone-mode: false | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| dotnet-quality: 'ga' | |
| - name: Build DaJet Data | |
| working-directory: src/dajet-data | |
| run: dotnet build --configuration Release | |
| - name: Pack DaJet Data | |
| working-directory: src/dajet-data | |
| run: dotnet pack --configuration Release --no-build --output ../nupkg | |
| - name: Build DaJet Type System | |
| working-directory: src/dajet-type-system | |
| run: dotnet build --configuration Release | |
| - name: Pack DaJet Type System | |
| working-directory: src/dajet-type-system | |
| run: dotnet pack --configuration Release --no-build --output ../nupkg | |
| - name: Build DaJet Metadata | |
| working-directory: src/dajet-metadata | |
| run: dotnet build --configuration Release | |
| - name: Pack DaJet Metadata | |
| working-directory: src/dajet-metadata | |
| run: dotnet pack --configuration Release --no-build --output ../nupkg | |
| - name: NuGet login (OIDC) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{secrets.NUGET_USER}} | |
| - name: NuGet push | |
| working-directory: src | |
| run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate |