Skip to content

Commit 92eba7f

Browse files
authored
add CI for npm build & publish (#573)
* add CI for npm build & publish * bump version to 0.0.6
1 parent b5490bb commit 92eba7f

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/publish.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 14 # Change this to your desired Node.js version
20+
21+
- name: Install pnpm
22+
run: npm install -g pnpm
23+
24+
- name: Build UI
25+
working-directory: ui
26+
run: |
27+
pnpm install
28+
pnpm build
29+
env:
30+
NODE_ENV: production
31+
32+
- name: Build API
33+
working-directory: api
34+
run: |
35+
pnpm install
36+
pnpm build
37+
env:
38+
NODE_ENV: production
39+
40+
- name: Publish to npm
41+
working-directory: api
42+
run: npm publish
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # NPM_TOKEN is a GitHub secret containing your npm token

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codepod",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"license": "MIT",
55
"scripts": {
66
"build": "tsc",

0 commit comments

Comments
 (0)