fix(emitter): strip trailing whitespace, fix C# string bug, format te… #22
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: prompty CSharp build and publish | |
| on: | |
| push: | |
| tags: | |
| - 'csharp/*' | |
| workflow_dispatch: | |
| jobs: | |
| prompty-tests: | |
| uses: ./.github/workflows/prompty-csharp-check.yml | |
| nuget-publish: | |
| name: publish nuget packages | |
| runs-on: ubuntu-latest | |
| needs: prompty-tests | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Determine version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#csharp/}" | |
| echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
| echo "Publishing version: $VERSION" | |
| - name: Set package versions | |
| working-directory: ./runtime/csharp | |
| run: | | |
| echo "Setting version to $VERSION" | |
| find . -name '*.csproj' -path '*/Prompty.*/Prompty.*.csproj' \ | |
| -exec sed -i "s|<Version>.*</Version>|<Version>${VERSION}</Version>|g" {} + | |
| - name: dotnet restore | |
| working-directory: ./runtime/csharp | |
| run: dotnet restore | |
| - name: dotnet pack | |
| working-directory: ./runtime/csharp | |
| run: dotnet pack --configuration Release --no-restore --output ./artifacts | |
| - name: NuGet login (OIDC trusted publishing) | |
| uses: NuGet/login@v1 | |
| id: nuget-login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push to NuGet | |
| working-directory: ./runtime/csharp | |
| run: | | |
| for pkg in ./artifacts/*.nupkg; do | |
| dotnet nuget push "$pkg" \ | |
| --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --skip-duplicate | |
| done |