diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..0b3aa5a --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,9 @@ +# Changesets + +A changeset records a package release: which packages, which bump, and the changelog text. + +- `pnpm changeset` writes one; commit it with the change it describes. +- Without one, the release job writes a patch changeset for every package whose published contents + changed (a minor, on 0.x, when a dependency moved to another breaking line). +- On `main`, pending changesets become the "chore: version packages" pull request; merging it + publishes the packages to npm. diff --git a/.changeset/config.json b/.changeset/config.json index b821332..426cd84 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", + "$schema": "https://unpkg.com/@changesets/config@4.0.1/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, "fixed": [], @@ -7,5 +7,9 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", + "privatePackages": { + "version": false, + "tag": false + }, "ignore": [] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ece6d3c..924c68f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,25 +4,19 @@ on: push: branches: [main] pull_request: - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true jobs: ci: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: "24" - cache: pnpm - - run: pnpm install --frozen-lockfile - - run: pnpm run lint:check - - run: pnpm run format:check - - run: pnpm run build - - run: pnpm run typecheck - - run: pnpm run test + uses: statewalker/.github/.github/workflows/ci.yml@main + + # Releases to npm: a version pull request while changes are unreleased, publishing once it is + # merged. npm's trusted publishers for these packages name this file (ci.yml). + release: + needs: ci + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: statewalker/.github/.github/workflows/release.yml@main + permissions: + contents: write + pull-requests: write + id-token: write + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b7a8a3d..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Release - -on: - push: - branches: [main] - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - release: - if: github.repository == 'statewalker/statewalker-shared' - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - id-token: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: "24" - cache: pnpm - registry-url: "https://registry.npmjs.org" - - run: pnpm install --frozen-lockfile - - run: pnpm run build - - name: Create release PR or publish - uses: changesets/action@v1 - with: - publish: pnpm run release-packages - version: pnpm run version-packages - commit: "chore: version packages" - title: "chore: version packages" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 00b4a73..ef6571a 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,7 @@ "lint:check": "biome check .", "format": "biome format --write .", "format:check": "biome format .", - "publish-all": "pnpm run build && pnpm -r publish --access public --no-git-checks", - "changeset": "changeset", - "version-packages": "changeset version", - "release-packages": "changeset publish" + "changeset": "changeset" }, "devDependencies": { "@biomejs/biome": "catalog:", diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..247bee9 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["github>statewalker/.github"] +}