docs: add technical preview note for Docusaurus #21
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'stable/**' | |
| workflow_dispatch: | |
| inputs: | |
| spec_ref: | |
| description: 'Git ref (branch/tag/SHA) in camunda/camunda to fetch spec from' | |
| required: false | |
| default: 'main' | |
| env: | |
| SPEC_REF: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.spec_ref) || vars.SPEC_REF_OVERRIDE || 'main' }} | |
| concurrency: | |
| group: orchestration-cluster-api-csharp-release-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| issues: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| generate: | |
| name: Generate & Test (.NET ${{ matrix.dotnet }} ${{ matrix.stack }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dotnet: ['8.0.x'] | |
| stack: [simple] | |
| include: | |
| - dotnet: '8.0.x' | |
| stack: full | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate SPEC_REF override | |
| if: env.SPEC_REF != 'main' | |
| run: | | |
| echo "SPEC_REF is pinned to '${SPEC_REF}' (not main)" | |
| ACK="${{ vars.SPEC_REF_OVERRIDE_ACK }}" | |
| EXPIRES="${{ vars.SPEC_REF_OVERRIDE_EXPIRES }}" | |
| if [ "$ACK" != "true" ]; then | |
| echo "::error::SPEC_REF_OVERRIDE is set but SPEC_REF_OVERRIDE_ACK is not 'true'. Set the repo variable to acknowledge the override." | |
| exit 1 | |
| fi | |
| if [ -z "$EXPIRES" ]; then | |
| echo "::error::SPEC_REF_OVERRIDE_EXPIRES repo variable is not set. Set it to a YYYY-MM-DD date." | |
| exit 1 | |
| fi | |
| TODAY=$(date +%Y-%m-%d) | |
| if [[ "$TODAY" > "$EXPIRES" ]]; then | |
| echo "::error::SPEC_REF_OVERRIDE expired on $EXPIRES (today is $TODAY). Remove the override or extend the expiry." | |
| exit 1 | |
| fi | |
| echo "Override valid (expires $EXPIRES)" | |
| - name: Export stable line config | |
| run: | | |
| echo "CAMUNDA_SDK_CURRENT_STABLE_MINOR=${{ vars['CAMUNDA_SDK_CURRENT_STABLE_MINOR'] }}" >> $GITHUB_ENV | |
| - name: Setup .NET ${{ matrix.dotnet }} | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Fetch & Bundle spec | |
| run: bash scripts/bundle-spec.sh | |
| - name: Generate SDK | |
| run: dotnet run --project src/Camunda.Orchestration.Sdk.Generator | |
| - name: Format Generated Code | |
| run: dotnet format src/Camunda.Orchestration.Sdk/Camunda.Orchestration.Sdk.csproj --no-restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Lint Check | |
| run: dotnet format --verify-no-changes | |
| - name: Unit Tests | |
| run: dotnet test test/Camunda.Orchestration.Sdk.Tests --configuration Release --no-build --verbosity normal | |
| - name: Start Integration Stack | |
| working-directory: docker | |
| run: | | |
| if [ "${{ matrix.stack }}" == "full" ]; then | |
| docker compose -f docker-compose-full.yaml up -d | |
| else | |
| docker compose -f docker-compose.yaml up -d | |
| fi | |
| - name: Wait for Services Healthy | |
| run: | | |
| set -e | |
| attempts=0 | |
| max_attempts=60 | |
| while [ $attempts -lt $max_attempts ]; do | |
| code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:9600/actuator/health/status || true) | |
| [ "$code" = "200" ] && echo "Broker healthy" && break | |
| sleep 5 | |
| attempts=$((attempts+1)) | |
| done | |
| [ $attempts -ge $max_attempts ] && echo "Broker not healthy" && exit 1 || true | |
| - name: Integration Tests | |
| run: dotnet test test/Camunda.Orchestration.Sdk.IntegrationTests --configuration Release --no-build --verbosity normal | |
| - name: Snapshot Spec & Metadata | |
| run: | | |
| set -e | |
| SPEC_DIR=external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2 | |
| HASH=$(find "$SPEC_DIR" -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum | cut -d ' ' -f1) | |
| SNAP=spec-snapshots/spec-${HASH}.tgz | |
| mkdir -p spec-snapshots | |
| if [ ! -f "$SNAP" ]; then | |
| tar -czf "$SNAP" -C "$SPEC_DIR" . | |
| echo "Created new spec snapshot: $SNAP" | |
| else | |
| echo "Spec snapshot already exists: $SNAP (no overwrite)" | |
| fi | |
| echo "spec snapshot: spec-snapshots/spec-${HASH}.tgz" | |
| - name: Detect generated drift | |
| id: detect | |
| run: | | |
| if git diff --quiet; then echo "changed=false" >> $GITHUB_OUTPUT; else echo "changed=true" >> $GITHUB_OUTPUT; fi | |
| - name: Commit generated artifacts (canonical) | |
| if: steps.detect.outputs.changed == 'true' && matrix.stack == 'simple' | |
| run: | | |
| git config user.name 'github-actions' | |
| git config user.email 'actions@github.com' | |
| git add -A | |
| git commit -m "fix(gen): regenerate artifacts" | |
| git push origin "HEAD:${{ github.ref_name }}" | |
| - name: Upload logs (always) | |
| if: always() | |
| working-directory: docker | |
| run: docker compose logs || true | |
| - name: Shutdown Integration Stack (always) | |
| if: always() | |
| working-directory: docker | |
| run: docker compose down -v || true | |
| outputs: | |
| changed: ${{ steps.detect.outputs.changed }} | |
| publish: | |
| name: Version & Publish (${{ github.ref_name }}) | |
| needs: generate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch remote refs for semantic-release | |
| run: | | |
| set -euo pipefail | |
| git fetch origin '+refs/heads/*:refs/remotes/origin/*' --prune | |
| git fetch origin '+refs/notes/*:refs/notes/*' || true | |
| - name: Export stable line config | |
| run: | | |
| echo "CAMUNDA_SDK_CURRENT_STABLE_MINOR=${{ vars['CAMUNDA_SDK_CURRENT_STABLE_MINOR'] }}" >> $GITHUB_ENV | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Restore .NET dependencies | |
| run: dotnet restore | |
| - name: NuGet login (OIDC Trusted Publishing) | |
| uses: NuGet/login@v1 | |
| id: nuget-login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Determine next version (dry-run) | |
| id: next_version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -e | |
| node scripts/next-version.mjs > next-version.out 2>&1 || { | |
| echo 'Semantic-release dry-run failed:' | |
| cat next-version.out | |
| exit 1 | |
| } | |
| echo "semantic-release summary:" | |
| grep -E '^(release_branch|release_channel|next_version)=' next-version.out || true | |
| VER=$(grep -E '^next_version=' next-version.out | tail -n 1 | cut -d '=' -f2) | |
| if [ -z "$VER" ]; then | |
| echo "No release required" | |
| echo "publish_needed=false" >> $GITHUB_OUTPUT | |
| echo "version=" >> $GITHUB_OUTPUT | |
| else | |
| echo "Next version: $VER" | |
| echo "publish_needed=true" >> $GITHUB_OUTPUT | |
| echo "version=$VER" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Publish (semantic-release) | |
| if: steps.next_version.outputs.publish_needed == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} | |
| run: npx semantic-release | |
| - name: Build Docs | |
| if: github.ref_name == 'main' | |
| run: bash scripts/build-docs.sh | |
| - name: Deploy Docs | |
| if: github.ref_name == 'main' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: docs/_site | |
| branch: gh-pages | |
| - name: Upload release analysis logs (always) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-analysis | |
| path: | | |
| next-version.out | |
| release-assets/ |