Skip to content

v10.0.0 - .NET 10 LTS #5

v10.0.0 - .NET 10 LTS

v10.0.0 - .NET 10 LTS #5

Workflow file for this run

name: Release
on:
release:
types: [ published ]
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version and detect .NET version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
MAJOR=$(echo $VERSION | cut -d. -f1)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "DOTNET_VERSION=${MAJOR}.0.x" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION, .NET version: ${MAJOR}.0.x"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ steps.version.outputs.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore CompactifAI.sln
- name: Build
run: dotnet build CompactifAI.sln --configuration Release --no-restore
- name: Test
run: dotnet test CompactifAI.sln --configuration Release --no-build --verbosity normal
- name: Pack
run: dotnet pack src/CompactifAI.Client/CompactifAI.Client.csproj --configuration Release --no-build --output ./nupkg /p:Version=${{ steps.version.outputs.VERSION }}
- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload package to release
uses: softprops/action-gh-release@v1
with:
files: ./nupkg/*.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}