diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cc1f6d749..8a755ee0a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,35 +10,48 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: node-version: 25 check-latest: true + - name: Install dependencies run: npm i + - name: Biome run: node --run biome:ci + - name: Typecheck run: node --run typecheck + - name: ESLint run: node --run eslint + - name: Prettier run: node --run prettier:check + - name: Bundle run: node --run build + - name: Build website run: node --run build:website + - name: Install Playwright Browsers run: npx playwright install chromium firefox + - name: Test run: node --run test timeout-minutes: 4 + - name: Visual regression test run: node --run visual + - name: Upload coverage uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Deploy gh-pages if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..68befcbfd0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,77 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to publish (e.g., 0.1.1, 0.2.0, 1.0.0)' + required: true + type: string + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v6 + with: + node-version: 25 + check-latest: true + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm i + + - name: Biome + run: node --run biome:ci + + - name: Typecheck + run: node --run typecheck + + - name: ESLint + run: node --run eslint + + - name: Prettier + run: node --run prettier:check + + - name: Bundle + run: node --run build + + - name: Build website + run: node --run build:website + + - name: Install Playwright Browsers + run: npx playwright install chromium firefox + + - name: Test + run: node --run test + timeout-minutes: 4 + + - name: Visual regression test + run: node --run visual + + - name: Update version + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + npm version ${{ inputs.version }} + + # https://docs.npmjs.com/trusted-publishers + - name: Publish to npm + run: npm publish + + - name: Push commit and tag + run: git push origin main --follow-tags + + - name: Create GitHub Release + run: gh release create v${{ inputs.version }} --title "v${{ inputs.version }}" --generate-notes + env: + GH_TOKEN: ${{ github.token }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index ad97190bc4..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -### Release process - -For maintainers only. - -- `cd` to the root of the repo. -- Checkout the `main` branch. -- Make sure your local branch is up to date, no unpushed or missing commits, stash any changes. -- Update the changelog, if necessary, and commit. -- Login to the `adazzle` npm account if you haven't already done so: - - `npm login` - - You can use `npm whoami` to check who you are logged in as. -- Bump the version and publish on npm: - - - To release a new `beta` version: - - `npm version prerelease --preid=beta -m "Publish %s"` - - `npm publish --tag beta` - - Relevant docs: - - https://docs.npmjs.com/cli/commands/npm-version - - https://docs.npmjs.com/cli/commands/npm-publish - - https://docs.npmjs.com/cli/using-npm/scripts - - https://git-scm.com/docs/git-push diff --git a/package.json b/package.json index b44f7fc805..8303d92167 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "type": "git", "url": "git+https://github.com/Comcast/react-data-grid.git" }, + "homepage": "https://github.com/Comcast/react-data-grid#readme", "bugs": "https://github.com/Comcast/react-data-grid/issues", "type": "module", "exports": {