Merge pull request #21 from Litenova-Solutions/feature/v3.1 #9
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 NuGet | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: read | |
| id-token: write # required for NuGet Trusted Publishing (OIDC) | |
| jobs: | |
| publish: | |
| name: Pack and Push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Extract version from tag | |
| id: version | |
| shell: bash | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Install Linux publish prerequisites | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang zlib1g-dev | |
| - name: Restore | |
| run: dotnet restore src/Host/Fuse.Cli/Fuse.Cli.csproj | |
| - name: Pack framework-dependent tool and runtime packages | |
| shell: pwsh | |
| run: | | |
| ./build/pack-tool.ps1 -Version ${{ steps.version.outputs.version }} -Rids linux-x64 | |
| - name: NuGet login (Trusted Publishing, short-lived key via OIDC) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| # The nuget.org account/profile name that owns the trusted publishing | |
| # policy. For an org-owned policy this is the organization name | |
| # (Litenova-Solutions). Stored as a secret per Microsoft's guidance. | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push to NuGet.org | |
| run: | | |
| dotnet nuget push src/Host/Fuse.Cli/nupkg/*.nupkg \ | |
| --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --skip-duplicate |