Skip to content

Commit 8fd344a

Browse files
author
skychx
committed
ci(config): remove changesets
1 parent 6b6cf9f commit 8fd344a

2 files changed

Lines changed: 27 additions & 11 deletions

File tree

.github/workflows/publish.yml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ on:
66
- 'v*'
77

88
permissions:
9+
contents: write # to create release
910
id-token: write # OpenID Connect token needed for provenance
10-
contents: write # to create release (changesets/action)
11-
pull-requests: write # to create pull request (changesets/action)
1211

1312
jobs:
1413
publish:
@@ -17,7 +16,7 @@ jobs:
1716
- name: Checkout code repository
1817
uses: actions/checkout@v4
1918
with:
20-
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
19+
# This makes Actions fetch all Git history
2120
fetch-depth: 0
2221

2322
- name: Setup pnpm
@@ -31,6 +30,7 @@ jobs:
3130
with:
3231
node-version: 22
3332
cache: 'pnpm'
33+
registry-url: 'https://registry.npmjs.org'
3434

3535
# Ensure npm 11.5.1 or later is installed
3636
- name: Update npm
@@ -45,12 +45,30 @@ jobs:
4545
- name: Build
4646
run: pnpm run build
4747

48-
- name: Create and publish versions
49-
uses: changesets/action@v1
48+
- name: Extract version from tag
49+
id: version
50+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
51+
52+
- name: Update package versions to tag version
53+
run: |
54+
VERSION="${{ steps.version.outputs.VERSION }}"
55+
echo "Updating all packages to version $VERSION"
56+
57+
# Update all package.json files in packages directory
58+
for pkg in packages/*/package.json; do
59+
echo "Updating $pkg to version $VERSION"
60+
jq --arg version "$VERSION" '.version = $version' "$pkg" > tmp.json && mv tmp.json "$pkg"
61+
done
62+
63+
- name: Create GitHub Release
64+
uses: softprops/action-gh-release@v1
5065
with:
51-
version: pnpm changeset:version
52-
publish: pnpm changeset:release
53-
commit: 'chore: release packages'
54-
title: 'chore: release packages'
66+
tag_name: ${{ github.ref_name }}
67+
name: Release ${{ steps.version.outputs.VERSION }}
68+
draft: false
69+
prerelease: false
5570
env:
5671
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- name: Publish to npm
74+
run: pnpm publish -r --no-git-checks --tag latest

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"test:watch": "vitest",
1111
"format": "prettier . --write",
1212
"format:check": "prettier . --check",
13-
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
14-
"changeset:release": "changeset publish",
1513
"prepare": "husky"
1614
},
1715
"keywords": [],

0 commit comments

Comments
 (0)