fix(static-renderer): type JSON renderers so JSONContent works withou… #1162
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 | |
| env: | |
| NODE_VERSION: 24 | |
| PNPM_VERSION: 11.2.2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| - 'release/*' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --strict-peer-dependencies | |
| - name: Run build | |
| run: pnpm run build && pnpm run build:demos | |
| - name: Archive package dist artifacts | |
| run: tar -cf package-dist-artifacts.tar packages/*/dist packages-deprecated/*/dist | |
| - name: Upload package dist artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: package-dist-artifacts | |
| if-no-files-found: error | |
| path: package-dist-artifacts.tar | |
| release: | |
| name: Bump Versions OR Release to Registry | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| needs: build | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| outputs: | |
| dist_tag: ${{ steps.resolve_dist_tag.outputs.dist_tag }} | |
| release_kind: ${{ steps.resolve_dist_tag.outputs.release_kind }} | |
| published: ${{ steps.changesets.outputs.published }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: pnpm | |
| - name: Update npm for trusted publishing | |
| run: npm install -g npm@11.6.2 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --strict-peer-dependencies | |
| - name: Download package dist artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: package-dist-artifacts | |
| path: . | |
| - name: Restore package dist artifacts | |
| run: tar -xf package-dist-artifacts.tar | |
| - name: Verify package dist artifacts | |
| run: bash ./scripts/check-package-dists.sh | |
| - name: Resolve npm dist-tag | |
| id: resolve_dist_tag | |
| run: | | |
| branch="${{ github.ref_name }}" | |
| if [ "$branch" = 'main' ]; then | |
| echo 'NPM_DIST_TAG=latest' >> "$GITHUB_ENV" | |
| echo 'dist_tag=latest' >> "$GITHUB_OUTPUT" | |
| echo 'release_kind=stable' >> "$GITHUB_OUTPUT" | |
| elif [ "$branch" = 'next' ]; then | |
| echo 'NPM_DIST_TAG=next' >> "$GITHUB_ENV" | |
| echo 'dist_tag=next' >> "$GITHUB_OUTPUT" | |
| echo 'release_kind=prerelease' >> "$GITHUB_OUTPUT" | |
| else | |
| release_tag="${branch#release/}" | |
| echo "NPM_DIST_TAG=${release_tag}-latest" >> "$GITHUB_ENV" | |
| echo "dist_tag=${release_tag}-latest" >> "$GITHUB_OUTPUT" | |
| echo 'release_kind=prerelease' >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run changesets release flow | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| createGithubReleases: false | |
| version: pnpm run version | |
| publish: pnpm changeset publish --tag ${{ steps.resolve_dist_tag.outputs.dist_tag }} | |
| title: ${{ github.ref_name == 'main' && 'Publish a new stable version' || 'Publish a new release version' }} | |
| commit: '${{ github.ref_name == ''main'' && ''chore(release): publish a new stable version'' || ''chore(release): publish a new release version'' }}' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| NPM_CONFIG_ACCESS: public | |
| notify-slack: | |
| name: Send notification to Slack | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: needs.release.outputs.published == 'true' | |
| timeout-minutes: 5 | |
| permissions: {} | |
| steps: | |
| - name: Send Slack notification | |
| uses: slackapi/slack-github-action@v3.0.3 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: webhook-trigger | |
| payload: | | |
| { | |
| "message": "[Tiptap Editor ${{ needs.release.outputs.release_kind == 'stable' && 'Release' || 'Pre-release' }}]: Published packages from branch ${{ github.ref_name }} with npm tag ${{ needs.release.outputs.dist_tag }}." | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| notify-slack-failure: | |
| name: Send failure notification to Slack | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: always() && needs.release.result == 'failure' | |
| timeout-minutes: 5 | |
| permissions: {} | |
| steps: | |
| - name: Send Slack failure notification | |
| uses: slackapi/slack-github-action@v3.0.3 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: webhook-trigger | |
| payload: | | |
| { | |
| "message": "[Tiptap Editor Release]: There was an issue publishing packages from branch ${{ github.ref_name }}. Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |