Skip to content

Merge pull request #25 from Litenova-Solutions/feature/v4-finish #12

Merge pull request #25 from Litenova-Solutions/feature/v4-finish

Merge pull request #25 from Litenova-Solutions/feature/v4-finish #12

Workflow file for this run

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: Verify version and read from codebase
id: version
shell: pwsh
run: |
# The codebase is the source of truth; fail the release if the tag does not match it.
./build/verify-version.ps1 -Tag "${{ github.ref_name }}"
$v = ([xml](Get-Content Directory.Build.props)).Project.PropertyGroup.Version |
Where-Object { $_ } | Select-Object -First 1
"version=$v" >> $env: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