Publish SpessaSharp NuGet Nightly #22
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 SpessaSharp NuGet Nightly | |
| on: | |
| schedule: | |
| # Runs at 00:00 UTC every day | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: nuget-nightly-publish | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check for changes | |
| id: changes | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: SpessaSharp/** | |
| - name: Exit if no changes | |
| if: steps.changes.outputs.any_changed != 'true' | |
| run: | | |
| echo "No changes. Skipping nightly publish." | |
| exit 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Get Nightly Version | |
| id: nightly | |
| run: echo "version=$(printf "%05d" "${{ github.run_number }}")" >> "$GITHUB_OUTPUT" | |
| - name: Pack | |
| run: dotnet pack SpessaSharp/SpessaSharp.csproj --configuration Release -p:Nightly=${{ steps.nightly.outputs.version }} --output ./nupkg | |
| - name: NuGet login | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push to NuGet | |
| run: dotnet nuget push ./nupkg/*.nupkg --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |