From 1afa7864effb2efcc12a2c54ecdc8b565c11f1d2 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Fri, 21 Nov 2025 14:52:43 +0000 Subject: [PATCH 1/2] Publish via workflow with trusted publishing --- .github/workflows/ci.yml | 13 ++++++ .github/workflows/publish.yml | 77 +++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 23 ----------- package.json | 1 + 4 files changed, 91 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 579172773d..8a60532aa8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,35 +10,48 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + - 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..7f11925853 --- /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@v5 + 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 04156fb789..0b6abbe03b 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": { From 7564c886c761de1a9997d92f95f469f63ed5754a Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 24 Nov 2025 17:44:30 +0000 Subject: [PATCH 2/2] update actions/checkout --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7f11925853..68befcbfd0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: id-token: write steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0