File tree Expand file tree Collapse file tree 3 files changed +43
-22
lines changed Expand file tree Collapse file tree 3 files changed +43
-22
lines changed Original file line number Diff line number Diff line change 8
8
build :
9
9
runs-on : ubuntu-latest
10
10
11
- strategy :
12
- matrix :
13
- node-version : ["18"]
14
-
15
11
steps :
16
12
- uses : actions/checkout@v3
17
13
with :
@@ -25,44 +21,43 @@ jobs:
25
21
- name : Setup Node.js
26
22
uses : actions/setup-node@v3
27
23
with :
28
- node-version : ${{ matrix.node-version }}
24
+ node-version : " 18 "
29
25
30
26
- name : Cache dependencies
31
- uses : actions/cache@v2
32
- id : yarn-cache
27
+ uses : actions/cache@v3
33
28
with :
34
29
path : |
35
30
**/node_modules
36
- key : ${{ runner.os }}-node-${{ matrix.node-version }} -yarn-${{ hashFiles('**/yarn.lock') }}
31
+ key : ${{ runner.os }}-node-18 -yarn-${{ hashFiles('**/yarn.lock') }}
37
32
restore-keys : |
38
- ${{ runner.os }}-node-${{ matrix.node-version }} -yarn-
33
+ ${{ runner.os }}-node-18 -yarn-
39
34
40
35
- name : Install dependencies
41
36
run : yarn install
42
37
43
38
- name : Type check
44
39
run : yarn typecheck
45
- continue-on-error : false
46
40
47
41
- name : Check code quality
48
42
run : |
49
- set -e
50
- trap 'echo "Error in $BASH_COMMAND at line $LINENO"' ERR
51
43
yarn lint
52
44
yarn format:check
53
45
yarn run --if-present generate
54
46
55
47
- name : Security Audit
56
- run : yarn audit --level moderate
48
+ run : yarn audit --level moderate || true
57
49
continue-on-error : true
58
50
51
+ - name : Security Audit Summary
52
+ if : success() || failure()
53
+ run : yarn audit --summary
54
+
59
55
- name : Archive production artifacts
60
- if : always()
61
- uses : actions/upload-artifact@v2
56
+ uses : actions/upload-artifact@v3
62
57
with :
63
58
name : build-artifacts
64
59
path : ./build/
65
60
66
61
- name : Error handling
67
- if : ${{ failure() }}
62
+ if : failure()
68
63
run : echo "CI failed. Please check the logs."
Original file line number Diff line number Diff line change @@ -12,33 +12,59 @@ jobs:
12
12
- uses : actions/setup-node@v3
13
13
with :
14
14
node-version : 18
15
+ - run : yarn
16
+ - run : yarn generate
17
+ - uses : actions/upload-artifact@v3
18
+ with :
19
+ name : built-package
20
+ path : |
21
+ ./path-to-your-build-folder
22
+ package.json
15
23
16
24
publish-npm :
17
25
needs : build
18
26
runs-on : ubuntu-latest
19
27
steps :
20
28
- uses : actions/checkout@v3
29
+ - uses : actions/download-artifact@v3
30
+ with :
31
+ name : built-package
21
32
- uses : actions/setup-node@v3
22
33
with :
23
34
node-version : 18
24
35
registry-url : https://registry.npmjs.org/
25
36
scope : " @smakss"
26
- - run : yarn && yarn generate
27
- - run : npm publish
37
+ - run : |
38
+ if grep -q "beta" package.json; then
39
+ echo "Publishing Beta to npm"
40
+ npm publish --tag beta
41
+ else
42
+ echo "Publishing Release to npm"
43
+ npm publish
44
+ fi
28
45
env:
29
- NODE_AUTH_TOKEN : ${{secrets.npm_token }}
46
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN }}
30
47
31
48
publish-gpr :
32
49
needs : build
33
50
runs-on : ubuntu-latest
34
51
steps :
35
52
- uses : actions/checkout@v3
53
+ - uses : actions/download-artifact@v3
54
+ with :
55
+ name : built-package
36
56
- uses : actions/setup-node@v3
37
57
with :
38
58
node-version : 18
39
59
registry-url : https://npm.pkg.github.com/
40
60
scope : " @smakss"
41
- - run : yarn && yarn generate
42
- - run : npm publish
61
+ - run : |
62
+ if grep -q "beta" package.json; then
63
+ echo "Publishing Beta to GitHub Package Registry"
64
+ npm publish --tag beta
65
+ else
66
+ echo "Publishing Release to GitHub Package Registry"
67
+ npm publish
68
+ fi
43
69
env:
44
70
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change 68
68
"typecheck" : " tsc -b ."
69
69
},
70
70
"type" : " module" ,
71
- "version" : " 3.1.0-beta.0 "
71
+ "version" : " 3.1.0-beta.1 "
72
72
}
You can’t perform that action at this time.
0 commit comments