fix(ci): use Node 24 in GitHub Actions #138
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: Build and publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Type check | |
| run: npm run typecheck | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps | |
| timeout-minutes: 5 | |
| - name: Test | |
| run: | | |
| npx tsc -p tsconfig.test.json | |
| npm run build:test-react-bundle | |
| npx wtr | |
| edge-integration: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Edge integration test | |
| env: | |
| EMBEDDED_WEB_TEST_BROWSERS: chromium | |
| EMBEDDED_WEB_CHROMIUM_CHANNEL: msedge | |
| run: | | |
| npx tsc -p tsconfig.test.json | |
| npx wtr .tmp/test-dist/test/corti-embedded.integration.test.js | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run prerelease | |
| publish: | |
| needs: [typecheck, test, edge-integration, build] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24.x" | |
| cache: "npm" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run prerelease | |
| - name: Set version from tag | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| npm version --no-git-tag-version "$TAG_VERSION" | |
| - name: Publish to npm | |
| run: | | |
| if [[ ${GITHUB_REF} == *alpha* ]]; then | |
| npm publish --tag alpha | |
| elif [[ ${GITHUB_REF} == *beta* ]]; then | |
| npm publish --tag beta | |
| elif [[ ${GITHUB_REF} == *rc* ]]; then | |
| npm publish --tag rc | |
| else | |
| npm publish | |
| fi |