Skip to content

Commit aa115a5

Browse files
committedMar 25, 2025
add new publish to npm action
1 parent ba1fc0f commit aa115a5

File tree

3 files changed

+120
-31
lines changed

3 files changed

+120
-31
lines changed
 

‎.github/workflows/ci.yml

+75-30
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,33 @@ on:
55

66
jobs:
77
CI:
8-
name: Editor Tests Flakiness Check
8+
name: Monorepo CI flow
99
runs-on: ubuntu-latest
1010

1111
steps:
1212
- uses: actions/checkout@v4
13+
with:
14+
submodules: "recursive"
15+
16+
- uses: actions/setup-java@v4
17+
with:
18+
java-version: "17"
19+
distribution: "temurin"
20+
cache: maven
21+
22+
- name: Build QuestDB
23+
run: mvn clean package -f packages/browser-tests/questdb/pom.xml -DskipTests -P build-binaries
24+
25+
- name: Extract QuestDB
26+
run: tar -xzf packages/browser-tests/questdb/core/target/questdb-*-rt-linux-x86-64.tar.gz -C tmp/
27+
28+
- name: Create DB Root
29+
run: mkdir tmp/dbroot
30+
31+
- name: Start QuestDB
32+
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh start -d ./tmp/dbroot
33+
env:
34+
QDB_DEV_MODE_ENABLED: "true"
1335

1436
- uses: actions/setup-node@v4
1537
with:
@@ -25,35 +47,58 @@ jobs:
2547
- name: Build @questdb/web-console
2648
run: yarn workspace @questdb/web-console run build
2749

28-
- name: Start web console server
29-
run: node packages/web-console/serve-dist.js &
30-
31-
- name: Run editor tests 10 times
32-
run: |
33-
for i in {1..10}; do
34-
echo "=== Running editor tests iteration $i ==="
35-
36-
# Stop and remove any existing container
37-
docker stop questdb || true
38-
docker rm questdb || true
39-
40-
# Start QuestDB with auth
41-
docker run -d --name questdb \
42-
-p 9000:9000 -p 9009:9009 \
43-
-e QDB_HTTP_USER=admin \
44-
-e QDB_HTTP_PASSWORD=quest \
45-
-e QDB_DEV_MODE_ENABLED=true \
46-
questdb/questdb:nightly
47-
48-
# Wait for QuestDB to be ready
49-
sleep 10
50-
51-
# Run the editor tests
52-
yarn workspace browser-tests test
53-
54-
echo "=== Completed iteration $i ==="
55-
done
50+
- name: Run bundle watcher on @questdb/web-console
51+
run: yarn workspace @questdb/web-console bundlewatch
52+
53+
- name: Run @questdb/web-console unit tests
54+
run: yarn workspace @questdb/web-console run test:prod
55+
56+
- name: Run browser-tests test - auth
57+
run: node packages/web-console/serve-dist.js & yarn workspace browser-tests test:auth
58+
59+
- name: Stop QuestDB
60+
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh stop
61+
62+
- name: Start QuestDB, set auth credentials
63+
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh start -d ./tmp/dbroot
64+
env:
65+
QDB_DEV_MODE_ENABLED: "true"
66+
QDB_HTTP_USER: "admin"
67+
QDB_HTTP_PASSWORD: "quest"
68+
QDB_CAIRO_MAT_VIEW_ENABLED: "true"
69+
70+
- name: Run browser-tests test
71+
run: yarn workspace browser-tests test
72+
73+
- name: Print Log Files
74+
if: success() || failure()
75+
run: cat tmp/dbroot/log/*
76+
77+
- name: Save QuestDB log on test failure
78+
if: failure()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: questdb-log
82+
path: tmp/dbroot/log/*
5683

5784
- name: Stop QuestDB
5885
if: success() || failure()
59-
run: docker stop questdb || true
86+
run: ./tmp/questdb-*-rt-linux-x86-64/bin/questdb.sh stop
87+
88+
- name: Publish @questdb/react-components to npm
89+
if: success() && github.ref == 'refs/heads/main'
90+
uses: JS-DevTools/npm-publish@v1
91+
with:
92+
token: ${{ secrets.NPM_TOKEN }}
93+
access: public
94+
check-version: true
95+
package: ./packages/react-components/package.json
96+
97+
- name: Publish @questdb/web-console to npm
98+
if: success() && github.ref == 'refs/heads/main'
99+
uses: JS-DevTools/npm-publish@v1
100+
with:
101+
token: ${{ secrets.NPM_TOKEN }}
102+
access: public
103+
check-version: true
104+
package: ./packages/web-console/package.json

‎.github/workflows/publish_to_npm.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish Packages to NPM
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
name: Publish Packages to NPM
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
submodules: "recursive"
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: "20"
19+
cache: "yarn"
20+
21+
- name: Install dependencies
22+
run: yarn install --immutable --immutable-cache
23+
24+
- name: Build @questdb/react-components
25+
run: yarn workspace @questdb/react-components run build
26+
27+
- name: Build @questdb/web-console
28+
run: yarn workspace @questdb/web-console run build
29+
30+
- name: Publish @questdb/react-components to npm
31+
uses: JS-DevTools/npm-publish@v1
32+
with:
33+
token: ${{ secrets.NPM_TOKEN }}
34+
access: public
35+
check-version: true
36+
package: ./packages/react-components/package.json
37+
38+
- name: Publish @questdb/web-console to npm
39+
uses: JS-DevTools/npm-publish@v1
40+
with:
41+
token: ${{ secrets.NPM_TOKEN }}
42+
access: public
43+
check-version: true
44+
package: ./packages/web-console/package.json

0 commit comments

Comments
 (0)
Failed to load comments.