fix(super-converter): normalize single-paragraph BIBLIOGRAPHY/INDEX/T… #972
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
| # Auto-releases on push to main (@next). | |
| # Stable releases are orchestrated centrally by release-stable.yml so that | |
| # every stable release shares one concurrency slot and one git push lane. | |
| # docs-stable is advanced by promote-stable-docs.yml when release-stable.yml | |
| # produces a real superdoc v* tag (no-op runs do not advance docs-stable). | |
| # Manual PR preview: dispatch with pr_number to publish @pr-<number> | |
| name: 📦 Release superdoc | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages/superdoc/**' | |
| - 'packages/layout-engine/**' | |
| - 'packages/super-editor/**' | |
| - 'packages/word-layout/**' | |
| - 'packages/preset-geometry/**' | |
| - 'shared/**' | |
| - 'pnpm-workspace.yaml' | |
| - '!**/*.md' | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: 'PR number to publish a preview package for (leave empty for normal release)' | |
| required: false | |
| type: number | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| concurrency: | |
| # Stable releases share the `release-stable` group so @semantic-release/git | |
| # pushes to `stable` serialize across workflows; per-workflow groups would | |
| # let releases race on `git push origin stable`. queue: max keeps GitHub | |
| # from dropping older pending stable releases when a stable push touches | |
| # multiple wrapper packages; default queue: single only allows one pending. | |
| # queue: max requires cancel-in-progress: false (cannot be combined with true). | |
| group: ${{ github.ref_name == 'stable' && 'release-stable' || format('{0}-{1}', github.workflow, github.ref) }} | |
| cancel-in-progress: false | |
| queue: max | |
| jobs: | |
| release: | |
| # Stable publishes must go through release-stable.yml; PR previews are still allowed. | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.ref_name != 'stable' || inputs.pr_number }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| # PR preview: check out the PR branch | |
| - name: Get PR head ref | |
| if: inputs.pr_number | |
| id: pr | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| PR_DATA=$(gh api repos/${{ github.repository }}/pulls/${{ inputs.pr_number }} --jq '{ref: .head.ref, sha: .head.sha}') | |
| echo "ref=$(echo $PR_DATA | jq -r .ref)" >> $GITHUB_OUTPUT | |
| echo "sha=$(echo $PR_DATA | jq -r .sha)" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ steps.pr.outputs.sha || '' }} | |
| token: ${{ steps.generate_token.outputs.token }} | |
| - name: Refresh branch head | |
| # Queued release runs may start against a stale checkout (queue: max | |
| # plus cancel-in-progress: false). Refresh to the current branch head | |
| # so @semantic-release/git pushes fast-forward; semantic-release no-ops | |
| # if no new commits were added since the previous queued run released. | |
| if: ${{ !inputs.pr_number }} | |
| run: | | |
| git fetch origin "${{ github.ref_name }}" --tags | |
| git checkout -B "${{ github.ref_name }}" "origin/${{ github.ref_name }}" | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Cache apt packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/apt-cache | |
| key: apt-canvas-${{ runner.os }}-v1 | |
| - name: Install canvas system dependencies | |
| run: | | |
| mkdir -p ~/apt-cache | |
| sudo apt-get update | |
| sudo apt-get install -y -o Dir::Cache::Archives="$HOME/apt-cache" \ | |
| build-essential \ | |
| libcairo2-dev \ | |
| libpango1.0-dev \ | |
| libjpeg-dev \ | |
| libgif-dev \ | |
| librsvg2-dev \ | |
| libpixman-1-dev | |
| - name: Install dependencies | |
| run: pnpm install | |
| # PR preview: set version before build so it's baked into the package | |
| - name: Set preview version | |
| if: inputs.pr_number | |
| id: version | |
| run: | | |
| BASE_VERSION=$(node -p "require('./packages/superdoc/package.json').version") | |
| PREVIEW_VERSION="${BASE_VERSION}-pr.${{ inputs.pr_number }}.$(date +%s)" | |
| echo "version=$PREVIEW_VERSION" >> $GITHUB_OUTPUT | |
| cd packages/superdoc | |
| npm version "$PREVIEW_VERSION" --no-git-tag-version | |
| - name: Build packages | |
| run: pnpm run build | |
| # Public-type contract gate: same coverage as PR CI (ci-superdoc.yml). | |
| # Runs before publishing so a release cannot ship a regression that | |
| # bypassed PR CI (manual republish, hotfix branch, recovery flow). | |
| - name: SuperDoc public interface check | |
| # Wraps the nine wrapper stages: contract-tiers-test, | |
| # contract-tiers, jsdoc-ratchet, build (skipped here), | |
| # consumer-typecheck-matrix, deep-type-audit-supported-root, | |
| # package-shape, export-snapshots, root-classification-closure. | |
| # --skip-build because the Build step above already ran | |
| # `pnpm run build` (which includes build:superdoc). | |
| run: pnpm check:public:superdoc --skip-build | |
| # PR preview: publish with pr-<number> dist-tag | |
| - name: Publish PR preview | |
| if: inputs.pr_number | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| node scripts/publish-superdoc.cjs \ | |
| --dist-tag pr-${{ inputs.pr_number }} \ | |
| --skip-build | |
| - name: Comment on PR | |
| if: inputs.pr_number | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh pr comment ${{ inputs.pr_number }} --body "$(cat <<'EOF' | |
| 📦 **Preview published:** `superdoc@${{ steps.version.outputs.version }}` | |
| ```bash | |
| npm install superdoc@pr-${{ inputs.pr_number }} | |
| ``` | |
| EOF | |
| )" | |
| # Normal release: semantic-release (only when NOT a PR preview) | |
| - name: Release | |
| if: ${{ !inputs.pr_number }} | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| LINEAR_TOKEN: ${{ secrets.LINEAR_TOKEN }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| working-directory: packages/superdoc | |
| run: pnpx semantic-release |