Skip to content

Commit 558da2b

Browse files
author
Konstantine Kalbazov
committed
Fix CI script for version syncing
1 parent 0a252e7 commit 558da2b

21 files changed

+147
-288
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,28 @@ jobs:
4444
VERSION=$(cat package.json | jq -r .version)
4545
echo "Using version: $VERSION"
4646
# Update all workspace package versions to match root package.json
47-
bun x workspaces-update-version $VERSION --force-publish --no-git-tag-version --no-push --yes
47+
for pkg in packages/*/package.json; do
48+
jq --arg version "$VERSION" '.version = $version' "$pkg" > tmp.$$.json && mv tmp.$$.json "$pkg"
49+
done
4850
4951
- name: Building for production
5052
env:
5153
NODE_ENV: production
5254
SKIP_PREFLIGHT_CHECK: 'true'
53-
run: bun run build --if-present
55+
run: |
56+
bun run --cwd=packages/component build
57+
bun run --cwd=packages/playground build
5458
5559
- name: Copying documents
5660
run: |
5761
cp CHANGELOG.md packages/component
5862
cp LICENSE packages/component
5963
cp README.md packages/component
6064
61-
- name: Running bun pack
65+
- name: Running npm pack
6266
run: |
6367
cd packages/component
64-
bun pack
68+
npm pack
6569
6670
- name: Uploading npm-tarball
6771
uses: actions/upload-artifact@v4
@@ -73,7 +77,8 @@ jobs:
7377
uses: actions/upload-artifact@v4
7478
with:
7579
name: gh-pages
76-
path: 'packages/playground/build/**/*'
80+
path: 'packages/playground/build'
81+
retention-days: 1
7782

7883
# "test" job will only run when not deploying, will build for instrumentation.
7984
test:
@@ -105,7 +110,9 @@ jobs:
105110
VERSION=$(cat package.json | jq -r .version)
106111
echo "Using version: $VERSION"
107112
# Update all workspace package versions to match root package.json
108-
bun x workspaces-update-version $VERSION --force-publish --no-git-tag-version --no-push --yes
113+
for pkg in packages/*/package.json; do
114+
jq --arg version "$VERSION" '.version = $version' "$pkg" > tmp.$$.json && mv tmp.$$.json "$pkg"
115+
done
109116
110117
- name: Running static code analysis
111118
run: |
@@ -116,7 +123,7 @@ jobs:
116123
env:
117124
NODE_ENV: test
118125
SKIP_PREFLIGHT_CHECK: 'true'
119-
run: bun run build --if-present
126+
run: bun run --cwd=packages/component build:full
120127

121128
- name: Starting Docker Compose
122129
run: bun run docker:up -- --detach
@@ -163,13 +170,13 @@ jobs:
163170

164171
- name: Publishing ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }}
165172
run: |
166-
bun config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
167-
bun publish *.tgz --tag main
173+
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
174+
npm publish *.tgz --tag main --access public
168175
169176
- name: Tagging dist-tag ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
170177
if: ${{ startsWith(github.ref, 'refs/tags/') }}
171178
run: |
172-
bun dist-tag add ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
179+
npm dist-tag add ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
173180
174181
- name: Drafting a new release
175182
uses: actions/create-release@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/coverage
44
/lib
55
node_modules/
6+
dist/
7+
packages/playground/dist/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Try out the demo at [https://compulim.github.io/react-scroll-to-bottom/](https:/
2727

2828
```jsx
2929
import { css } from 'emotion';
30-
import ScrollToBottom from 'react-scroll-to-bottom';
30+
import ScrollToBottom from '@koteus/react-scroll-to-bottom';
3131

3232
const ROOT_CSS = css({
3333
height: 600,
@@ -184,7 +184,7 @@ The following sample code will put a button inside the content view only if the
184184
> Note: `useScrollToBottom` can only be called inside components hosted under `<ScrollToBottom>`.
185185
186186
```jsx
187-
import ScrollToBottom, { useScrollToBottom, useSticky } from 'react-scroll-to-bottom';
187+
import ScrollToBottom, { useScrollToBottom, useSticky } from '@koteus/react-scroll-to-bottom';
188188

189189
const Content = () => {
190190
const scrollToBottom = useScrollToBottom();
@@ -331,7 +331,7 @@ This context contains state of the container.
331331
The following sample code will put a button inside the content view only if the view is not at the bottom. When the button is clicked, it will scroll the view to the bottom.
332332

333333
```jsx
334-
import ScrollToBottom from 'react-scroll-to-bottom';
334+
import ScrollToBottom from '@koteus/react-scroll-to-bottom';
335335

336336
const Content = ({ scrollToBottom, sticky }) => {
337337
return (

0 commit comments

Comments
 (0)