Skip to content

Commit c7fb785

Browse files
committed
chore: ci wip
1 parent 4957185 commit c7fb785

File tree

4 files changed

+62
-5
lines changed

4 files changed

+62
-5
lines changed

.github/workflows/publish-npm.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to NPM
1+
name: Publish nightly to NPM
22

33
on:
44
# Allows you to run this workflow manually from the Actions tab
@@ -13,3 +13,49 @@ jobs:
1313
name: Publish to NPM
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 15
16+
defaults:
17+
run:
18+
working-directory: ./v1/typescript-definitions
19+
steps:
20+
- uses: actions/checkout@v5
21+
- uses: actions/setup-node@v5
22+
with:
23+
node-version: 24
24+
package-manager-cache: false
25+
registry-url: "https://registry.npmjs.org"
26+
27+
# Ensure npm 11.5.1 or later is installed:
28+
# - name: Update npm
29+
# run: npm install -g npm@latest
30+
31+
- name: Prepare Environment
32+
# Install from package-lock.json:
33+
run: npm ci
34+
env:
35+
CI: true
36+
37+
- name: Get the Prerelease tag
38+
id: prerelease-tag
39+
uses: yuya-takeyama/docker-tag-from-github-ref-action@2b0614b1338c8f19dd9d3ea433ca9bc0cc7057ba
40+
with:
41+
remove-version-tag-prefix: false
42+
43+
- name: Bump version to prerelease
44+
run: |
45+
PRERELEASE_TAG=nightly-$(echo "${{ steps.prerelease-tag.outputs.tag }}" | sed -r 's/[^a-z0-9]+/-/gi')
46+
npm version prerelease --preid $PRERELEASE_TAG-$COMMIT_DATE-$GIT_HASH
47+
48+
- name: Generate types
49+
run: npm run generate-types
50+
env:
51+
CI: true
52+
53+
- name: Build
54+
run: npm run build
55+
env:
56+
CI: true
57+
58+
- name: Publish to NPM
59+
run: npm publish --tag nightly
60+
env:
61+
CI: true

v1/typescript-definitions/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,15 @@ npm run build
7171
npm run watch
7272

7373
```
74+
75+
### Publish to NPM
76+
77+
To publish a new version to NPM:
78+
79+
1. Bump the version `npm version major|minor|patch`
80+
2. Commit and push to GitHub
81+
3. Go to the Actions tab and trigger the "Publish to NPM" workflow
82+
83+
To publish a nightly build to NPM:
84+
85+
1. Go to the Actions tab and trigger the "Publish nightly to NPM" workflow

v1/typescript-definitions/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v1/typescript-definitions/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"scripts": {
1818
"build": "tsc --build",
1919
"watch": "tsc --watch",
20-
"generate-types": "node scripts/generate-types.js",
21-
"do:publish": "npm run generate-types && npm run build && npm publish --access public"
20+
"generate-types": "node scripts/generate-types.js"
2221
},
2322
"devDependencies": {
2423
"typescript": "^5.6.3",

0 commit comments

Comments
 (0)