Make RequestContext.get reflect missing values #609
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 | |
| 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/*/.changes -name "*.md" ! -name "README.md" 2>/dev/null) | |
| 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.get_tag.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@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: 'package.json' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Get Playwright Version | |
| id: playwright-version | |
| run: echo "version=$(pnpm --filter @remix-run/ui exec playwright --version | cut -d ' ' -f2)" >> $GITHUB_OUTPUT | |
| - name: Cache Playwright Browsers | |
| uses: actions/cache@v5 | |
| id: cache-browsers | |
| continue-on-error: true | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} | |
| - name: Install Playwright Browsers | |
| if: steps.cache-browsers.outputs.cache-hit != 'true' | |
| run: pnpm --filter @remix-run/ui exec playwright install --with-deps | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Publish to npm and create releases | |
| run: node ./scripts/publish.ts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Output tag | |
| id: get_tag | |
| run: echo "tag=$(git tag --points-at HEAD | grep -e '^remix@3')" >> $GITHUB_OUTPUT | |
| docs: | |
| name: Update API 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 remix-api-docs | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.REMIX_API_DOCS_PAT }} | |
| script: | | |
| await github.rest.repos.createDispatchEvent({ | |
| owner: 'remix-run', | |
| repo: 'remix-api-docs', | |
| event_type: 'update-docs', | |
| client_payload: { tag: '${{ needs.publish.outputs.tag }}' } | |
| }); |