Fix tests #32
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'master' | |
| paths: | |
| - 'src/**' | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| DOTNET_NOLOGO: true | |
| NuGetDirectory: nuget-package/ | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Restore dependencies | |
| run: dotnet restore TALXIS.CLI.sln | |
| - name: Build | |
| run: dotnet build TALXIS.CLI.sln --configuration Release --no-restore | |
| - name: Run tests (including integration tests) | |
| run: dotnet test TALXIS.CLI.sln --configuration Release --no-build --logger "trx;LogFileName=test_results.trx" | |
| create_nuget: | |
| needs: [ test ] | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Create NuGet package | |
| run: | | |
| dotnet pack src/TALXIS.CLI/TALXIS.CLI.csproj --configuration Release | |
| dotnet pack src/TALXIS.CLI.MCP/TALXIS.CLI.MCP.csproj --configuration Release | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget | |
| if-no-files-found: error | |
| retention-days: 7 | |
| path: | | |
| src/TALXIS.CLI/bin/Release/*.nupkg | |
| src/TALXIS.CLI.MCP/bin/Release/*.nupkg | |
| deploy: | |
| needs: [ create_nuget ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget | |
| path: ${{ env.NuGetDirectory }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Publish NuGet package | |
| run: | | |
| foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { | |
| dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| } |