name: Publish on: push: branches: - main concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: check: name: Check release readiness runs-on: ubuntu-latest outputs: has_change_files: ${{ steps.check.outputs.has_change_files }} steps: - name: Checkout uses: actions/checkout@v6 - name: Check for change files id: check run: | # Look for change files in any package's .changes directory (excluding README.md) change_files=$(find packages -maxdepth 3 -type f -path 'packages/*/.changes/*.md' ! -name "README.md") if [ -n "$change_files" ]; then echo "Change files found (blocking publish):" echo "$change_files" echo "has_change_files=true" >> $GITHUB_OUTPUT else echo "No change files found, proceeding to publish." echo "has_change_files=false" >> $GITHUB_OUTPUT fi publish: name: Publish any unreleased packages needs: check if: needs.check.outputs.has_change_files == 'false' runs-on: ubuntu-latest outputs: tag: ${{ steps.publish.outputs.tag }} permissions: contents: write # Required for creating tags and GitHub releases id-token: write # OIDC ID token is used for authentication with npm/jsr steps: - name: Checkout uses: actions/checkout@v6 - name: Install pnpm uses: pnpm/action-setup@v6 - name: Install Node.js uses: ./.github/actions/setup-node-pnpm-cache - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build packages run: pnpm build - name: Validate generated remix package files run: pnpm run validate-remix-package - name: Publish to npm and create releases id: publish run: node ./scripts/publish.ts env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} post_release: name: Comment on and archive released items needs: publish if: startsWith(needs.publish.outputs.tag, 'remix@') runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout release history uses: actions/checkout@v6 with: fetch-depth: 0 - name: Install Node.js uses: actions/setup-node@v6 with: node-version-file: package.json - name: Comment on and archive released items run: node scripts/post-release.ts env: RELEASE_TAG: ${{ needs.publish.outputs.tag }} # Requires organization Projects and repository Issues/Pull requests read/write access. GH_TOKEN: ${{ secrets.GH_REMIX_PAT }} docs: name: Deploy docs needs: publish # Don't run on no-op publish runs (i.e., docs updates on a clean main branch) if: needs.publish.outputs.tag != '' runs-on: ubuntu-latest steps: - name: Trigger the Docs and UI deploys uses: actions/github-script@v8 with: # Needs permission to dispatch events to both docs repos. github-token: ${{ secrets.REMIX_API_DOCS_PAT }} script: | let ref = '${{ needs.publish.outputs.tag }}'; let deploys = [ ['remix-docs', 'update-docs'], ['remix-ui-docs', 'update-ui'], ]; for (let [repo, event_type] of deploys) { await github.rest.repos.createDispatchEvent({ owner: 'remix-run', repo, event_type, client_payload: { ref }, }); }