File tree 4 files changed +68
-37
lines changed
4 files changed +68
-37
lines changed Original file line number Diff line number Diff line change
1
+ name : Node.js CI
2
+
3
+ on :
4
+ push :
5
+ branches : [ master ]
6
+ pull_request :
7
+ branches : [ master ]
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ubuntu-latest
12
+
13
+ strategy :
14
+ matrix :
15
+ node-version : [18.x]
16
+
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+
20
+ - name : Use Node.js ${{ matrix.node-version }}
21
+ uses : actions/setup-node@v2
22
+ with :
23
+ node-version : ${{ matrix.node-version }}
24
+
25
+ - name : Install dependencies
26
+ run : npm install
27
+
28
+ - name : Run unit tests
29
+ run : npm test
30
+
31
+ - name : Build project
32
+ run : npm run build
33
+
34
+ - name : docs
35
+ run : npm run docs
36
+
37
+ - name : Deploy to GitHub Pages
38
+ uses : peaceiris/actions-gh-pages@v3
39
+ with :
40
+ github_token : ${{ secrets.GITHUB_TOKEN }}
41
+ publish_dir : ./public
42
+
43
+ - name : Check npm version
44
+ id : check-npm-version
45
+ run : |
46
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
47
+ PUBLISHED_VERSION=$(npm view . version 2>/dev/null || echo "0.0.0")
48
+ if [ "$CURRENT_VERSION" != "$PUBLISHED_VERSION" ]; then
49
+ echo "::set-output name=publish::true"
50
+ else
51
+ echo "::set-output name=publish::false"
52
+ fi
53
+
54
+ - name : Publish to npm
55
+ if : steps.check-npm-version.outputs.publish == 'true'
56
+ run : |
57
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
58
+ npm run release
59
+
60
+ - name : Create git tag
61
+ if : steps.check-npm-version.outputs.publish == 'true'
62
+ run : |
63
+ VERSION=$(node -p "require('./package.json').version")
64
+ git config --global user.name "github-actions[bot]"
65
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
66
+ git tag -a v$VERSION -m "Release v$VERSION"
67
+ git push origin v$VERSION
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @feng3d/render-api" ,
3
- "version" : " 0.0.2 " ,
3
+ "version" : " 0.0.3 " ,
4
4
"description" : " 渲染接口" ,
5
5
"author" : " feng" ,
6
6
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments