Skip to content

Commit 98d4234

Browse files
committed
ci: changeset check, make changeset more like apollo-server CI
1 parent 7381f99 commit 98d4234

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

.changeset/blue-jeans-buy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,19 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- uses: ./.github/actions/node
5555
- run: npm run spell-check
56+
57+
# Ensure that any PR that changes packages has a changeset on it (perhaps an
58+
# empty one created with `changeset --empty`). We run the Changesets job
59+
# itself on all branches so that we can require it to pass, gbut we don't run
60+
# the actual check on the "Version Packages" PRs themselves.
61+
changeset:
62+
runs-on: ubuntu-latest
63+
name: Changesets
64+
steps:
65+
- uses: actions/checkout@v4
66+
with:
67+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
68+
fetch-depth: 0
69+
- uses: ./.github/actions/node
70+
- run: npm run changeset-check
71+
if: ${{ ! startsWith(github.head_ref, 'changeset-release/') }}

.github/workflows/release-pr.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,12 @@ jobs:
1616
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1717
fetch-depth: 0
1818

19-
- name: Install Node with Mise
20-
uses: jdx/mise-action@v2
21-
22-
- name: Setup Node.js 16.x
23-
uses: actions/setup-node@v4
24-
with:
25-
cache: 'npm'
26-
27-
- name: Install Dependencies
28-
run: npm ci
29-
19+
- uses: ./.github/actions/node
3020
- name: Create Release Pull Request / NPM Publish
3121
uses: changesets/action@v1
3222
with:
33-
publish: npm run publish-changeset
23+
publish: npm run changeset-publish
24+
version: npm run changeset-version
3425
env:
3526
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3627
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"prepack": "npm run build",
2424
"prettier-check": "prettier --check .",
2525
"prettier-fix": "prettier --write .",
26-
"publish-changeset": "changeset publish",
26+
"changeset-publish": "npm run compile && changeset publish",
27+
"changeset-check": "changeset status --verbose --since=origin/main",
28+
"changeset-version": "changeset version && npm i",
2729
"spell-check": "cspell lint '**' --no-progress || (echo 'Add any real words to cspell-dict.txt.'; exit 1)",
2830
"test": "jest",
2931
"test:ci": "jest --coverage --ci --maxWorkers=2 --reporters=default --reporters=jest-junit",

0 commit comments

Comments
 (0)