Skip to content

v1.1.0 - API Endpoint Mapping #1

v1.1.0 - API Endpoint Mapping

v1.1.0 - API Endpoint Mapping #1

Workflow file for this run

name: Publish to NuGet
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 1.0.1)'
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Set version
run: |
if [ "${{ github.event_name }}" == "release" ]; then
VERSION=${{ github.event.release.tag_name }}
else
VERSION=${{ github.event.inputs.version }}
fi
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test --no-restore --verbosity normal
- name: Pack
run: dotnet pack src/CodeContext.CLI/CodeContext.CLI.csproj --configuration Release --no-build -p:Version=${{ env.VERSION }} -o ./artifacts
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate