This repository was archived by the owner on Apr 18, 2026. It is now read-only.
chore(deps): Bump dotnet-sdk from 10.0.201 to 11.0.100.pre.preview.2.26159.112 #32
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (without v prefix)' | |
| required: true | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| DOTNET_NOLOGO: true | |
| jobs: | |
| # Layer 1: Compute version deterministically | |
| version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.ver.outputs.version }} | |
| is_release: ${{ steps.ver.outputs.is_release }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| path: ANcpLua-netagents | |
| - id: ver | |
| working-directory: ANcpLua-netagents | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| echo "is_release=true" >> $GITHUB_OUTPUT | |
| elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "is_release=true" >> $GITHUB_OUTPUT | |
| else | |
| COMMITS=$(git rev-list --count HEAD) | |
| SHA=$(git rev-parse --short HEAD) | |
| echo "version=0.0.$COMMITS-ci.g$SHA" >> $GITHUB_OUTPUT | |
| echo "is_release=false" >> $GITHUB_OUTPUT | |
| fi | |
| # Layer 2: Build and pack | |
| build: | |
| needs: version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: ANcpLua-netagents | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: ANcpLua/ANcpLua.Roslyn.Utilities | |
| path: ANcpLua.Roslyn.Utilities | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: ANcpLua-netagents/global.json | |
| - name: Build | |
| working-directory: ANcpLua-netagents | |
| run: dotnet build netagents.slnx -c Release -p:Version=${{ needs.version.outputs.version }} | |
| env: | |
| CI: true | |
| - name: Pack | |
| working-directory: ANcpLua-netagents | |
| run: | | |
| dotnet pack src/Qyl.Agents.Abstractions/Qyl.Agents.Abstractions.csproj -c Release -o artifacts -p:Version=${{ needs.version.outputs.version }} --no-build | |
| dotnet pack src/Qyl.Agents.Generator/Qyl.Agents.Generator.csproj -c Release -o artifacts -p:Version=${{ needs.version.outputs.version }} --no-build | |
| dotnet pack src/Qyl.Agents/Qyl.Agents.csproj -c Release -o artifacts -p:Version=${{ needs.version.outputs.version }} --no-build | |
| dotnet pack src/NetAgents/NetAgents.csproj -c Release -o artifacts -p:Version=${{ needs.version.outputs.version }} --no-build | |
| env: | |
| CI: true | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: packages | |
| path: ANcpLua-netagents/artifacts/*.nupkg | |
| if-no-files-found: error | |
| # Layer 3: Test (cross-platform) | |
| test: | |
| needs: [version, build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: ANcpLua-netagents | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: ANcpLua/ANcpLua.Roslyn.Utilities | |
| path: ANcpLua.Roslyn.Utilities | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: ANcpLua-netagents/global.json | |
| - name: Test NetAgents | |
| working-directory: ANcpLua-netagents | |
| run: dotnet test --project tests/NetAgents.Tests/NetAgents.Tests.csproj -c Release -p:Version=${{ needs.version.outputs.version }} | |
| env: | |
| CI: true | |
| - name: Test Qyl.Agents.Generator | |
| working-directory: ANcpLua-netagents | |
| run: dotnet test --project tests/Qyl.Agents.Generator.Tests/Qyl.Agents.Generator.Tests.csproj -c Release -p:Version=${{ needs.version.outputs.version }} | |
| env: | |
| CI: true | |
| - name: Test Qyl.Agents | |
| working-directory: ANcpLua-netagents | |
| run: dotnet test --project tests/Qyl.Agents.Tests/Qyl.Agents.Tests.csproj -c Release -p:Version=${{ needs.version.outputs.version }} | |
| env: | |
| CI: true | |
| # Layer 4: Publish (only on tags/dispatch, after tests pass) | |
| publish: | |
| needs: [version, build, test] | |
| if: needs.version.outputs.is_release == 'true' | |
| runs-on: ubuntu-latest | |
| environment: nuget | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: packages | |
| path: artifacts/ | |
| - uses: actions/setup-dotnet@v5 | |
| - name: Authenticate to NuGet (trusted publishing) | |
| id: login | |
| uses: NuGet/login@v1 | |
| with: | |
| user: ANcpLua | |
| - name: Push to NuGet | |
| run: | | |
| for pkg in artifacts/*.nupkg; do | |
| dotnet nuget push "$pkg" \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" \ | |
| --skip-duplicate | |
| done |