From d13d8432e081decabedd4fc87058313a2c2ddb2e Mon Sep 17 00:00:00 2001 From: Mateusz Tkacz Date: Thu, 11 Jun 2026 11:55:49 +0200 Subject: [PATCH 1/4] ci: release public packages on merge to main Co-Authored-By: Claude Fable 5 --- .github/workflows/release.yml | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d4ffbd5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,75 @@ +name: Release + +on: + push: + branches: + - main + +# Serialize releases so two quickly-merged PRs can't race on the +# version commit / npm publish. +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + +permissions: + contents: write + +jobs: + release: + name: Version and publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: pnpm + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + # Private-only PRs merge without changesets — in that case there is + # nothing to release and the rest of the job is skipped. + - name: Check for pending changesets + id: changesets + run: | + count=$(find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' | wc -l | tr -d ' ') + echo "count=$count" >> "$GITHUB_OUTPUT" + echo "Pending changesets: $count" + + - name: Version packages + if: steps.changesets.outputs.count != '0' + run: | + pnpm changeset version + pnpm install --lockfile-only + + - name: Commit version bump + if: steps.changesets.outputs.count != '0' + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "chore: version packages" + + - name: Build and publish to npm + if: steps.changesets.outputs.count != '0' + run: pnpm release + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + # Pushed only after a successful publish, so a failed publish leaves + # main untouched and the run can simply be retried. + - name: Push version commit and tags + if: steps.changesets.outputs.count != '0' + run: | + git push origin main + git push origin --tags From ce498f8c2df01030e95c3bc76281c20fb1836b1d Mon Sep 17 00:00:00 2001 From: Mateusz Tkacz Date: Thu, 11 Jun 2026 12:25:40 +0200 Subject: [PATCH 2/4] chore: test --- apps/app/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/app/src/index.ts b/apps/app/src/index.ts index 5f7821d..5f20609 100644 --- a/apps/app/src/index.ts +++ b/apps/app/src/index.ts @@ -1,5 +1,5 @@ import { greet } from '@tmp-test-changesets/public-lib' import { greetLoudly } from '@tmp-test-changesets/private-lib' -console.log(greet('world')) +console.log(greet('world!')) console.log(greetLoudly('world')) From cc751f3a09d31723f376e4b3cb28107d26ce9c8e Mon Sep 17 00:00:00 2001 From: Mateusz Tkacz Date: Thu, 11 Jun 2026 13:27:02 +0200 Subject: [PATCH 3/4] chore: require changesets for packages/*, exempt apps Co-Authored-By: Claude Fable 5 --- .changeset/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index 7201626..c68604a 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,8 +8,8 @@ "baseBranch": "main", "updateInternalDependencies": "patch", "privatePackages": { - "version": false, + "version": true, "tag": false }, - "ignore": [] + "ignore": ["@tmp-test-changesets/app"] } From 5054657b8216576527a23d19e61c639d21bd697d Mon Sep 17 00:00:00 2001 From: Mateusz Tkacz Date: Thu, 11 Jun 2026 15:10:40 +0200 Subject: [PATCH 4/4] chore: simplify workflow --- .github/workflows/changeset-check.yml | 2 +- .github/workflows/release.yml | 75 --------------------------- 2 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/changeset-check.yml b/.github/workflows/changeset-check.yml index 140943d..b2b4ad6 100644 --- a/.github/workflows/changeset-check.yml +++ b/.github/workflows/changeset-check.yml @@ -32,4 +32,4 @@ jobs: # and no changeset covers it. Private packages and apps are excluded via # `privatePackages: { version: false }` in .changeset/config.json. - name: Check changesets for changed public packages - run: pnpm changeset status --since=origin/${{ github.base_ref }} + run: pnpm changeset status --since=main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d4ffbd5..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -# Serialize releases so two quickly-merged PRs can't race on the -# version commit / npm publish. -concurrency: - group: release-${{ github.ref }} - cancel-in-progress: false - -permissions: - contents: write - -jobs: - release: - name: Version and publish - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 24 - cache: pnpm - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - # Private-only PRs merge without changesets — in that case there is - # nothing to release and the rest of the job is skipped. - - name: Check for pending changesets - id: changesets - run: | - count=$(find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' | wc -l | tr -d ' ') - echo "count=$count" >> "$GITHUB_OUTPUT" - echo "Pending changesets: $count" - - - name: Version packages - if: steps.changesets.outputs.count != '0' - run: | - pnpm changeset version - pnpm install --lockfile-only - - - name: Commit version bump - if: steps.changesets.outputs.count != '0' - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -A - git commit -m "chore: version packages" - - - name: Build and publish to npm - if: steps.changesets.outputs.count != '0' - run: pnpm release - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - # Pushed only after a successful publish, so a failed publish leaves - # main untouched and the run can simply be retried. - - name: Push version commit and tags - if: steps.changesets.outputs.count != '0' - run: | - git push origin main - git push origin --tags