From 695ef31c0772cb69311248b7e5557772da3e4b2a Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Wed, 2 Sep 2026 23:50:12 +0000 Subject: [PATCH 1/3] ci: standardize npm releases --- .github/workflows/ci.yml | 28 ++++++++++++------ .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ .release-it.json | 15 +++++++--- package.json | 3 +- 4 files changed, 86 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a120fe..6e7d6c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,29 @@ -name: ci +name: CI on: + pull_request: push: + branches: [main] + +permissions: + contents: read jobs: - ubuntu: + checks: runs-on: ubuntu-latest - env: - COREPACK_DEFAULT_TO_LATEST: 0 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with: - node-version: '20' - - run: npm i -g --force corepack && corepack enable - - run: pnpm install + node-version: 24 + cache: pnpm + - name: Validate pull request title + if: github.event_name == 'pull_request' + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + echo "$PR_TITLE" | grep -Eq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?!?: .+' + - run: pnpm install --frozen-lockfile - run: pnpm prepack - run: pnpm lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c579a0d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release + +on: + workflow_dispatch: + inputs: + channel: + description: npm distribution channel + required: true + default: latest + type: choice + options: + - latest + - next + +permissions: + contents: read + +concurrency: + group: release + cancel-in-progress: false + +jobs: + release: + runs-on: ubuntu-latest + environment: npm-publish + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + fetch-depth: 0 + token: ${{ secrets.RELEASE_GITHUB_TOKEN }} + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 + with: + node-version: 24 + registry-url: https://registry.npmjs.org + cache: pnpm + - run: pnpm install --frozen-lockfile + - name: Configure release identity + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Publish stable release + if: inputs.channel == 'latest' + run: pnpm release -- --ci + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} + - name: Publish next release + if: inputs.channel == 'next' + run: pnpm release -- --ci --preRelease=next + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} diff --git a/.release-it.json b/.release-it.json index ead0163..447bdaa 100644 --- a/.release-it.json +++ b/.release-it.json @@ -1,20 +1,27 @@ { "git": { "commitMessage": "chore(release): v${version}", - "tagName": "v${version}" + "tagName": "v${version}", + "requireBranch": "main", + "requireCommits": true }, "github": { "release": true, - "releaseName": "v${version}", - "web": true + "releaseName": "v${version}" }, "hooks": { - "before:init": ["pnpm lint"], + "before:init": [ + "pnpm lint" + ], "after:bump": "git add CHANGELOG.md" }, "plugins": { "release-it-changelogen": { "disableVersion": true } + }, + "npm": { + "publish": true, + "skipChecks": true } } diff --git a/package.json b/package.json index 4f68e97..9058589 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "@antelopejs/interface-core": ">=0.0.3 <1.0.0" }, "publishConfig": { - "access": "public" + "access": "public", + "provenance": true }, "antelopeJs": { "skills": [ From 5c4e00af49f7006c79248639703902785c2229db Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 3 Sep 2026 00:00:24 +0000 Subject: [PATCH 2/3] style: format release configuration --- .release-it.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.release-it.json b/.release-it.json index 447bdaa..7365938 100644 --- a/.release-it.json +++ b/.release-it.json @@ -10,9 +10,7 @@ "releaseName": "v${version}" }, "hooks": { - "before:init": [ - "pnpm lint" - ], + "before:init": ["pnpm lint"], "after:bump": "git add CHANGELOG.md" }, "plugins": { From 1aec7c0db82ff3d2a29feaf0a2ef698db75bd62e Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 3 Sep 2026 16:06:38 +0000 Subject: [PATCH 3/3] fix(ci): pass release arguments correctly --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c579a0d..0165ffe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,11 +44,11 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Publish stable release if: inputs.channel == 'latest' - run: pnpm release -- --ci + run: pnpm release --ci env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} - name: Publish next release if: inputs.channel == 'next' - run: pnpm release -- --ci --preRelease=next + run: pnpm release --ci --preRelease=next env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}