File tree Expand file tree Collapse file tree 6 files changed +41
-28
lines changed Expand file tree Collapse file tree 6 files changed +41
-28
lines changed Original file line number Diff line number Diff line change @@ -33,19 +33,19 @@ jobs:
33
33
uses : actions/setup-node@v3
34
34
with :
35
35
node-version : ${{ matrix.node-version }}
36
- cache : ' npm'
37
-
38
- - name : Use cached node_modules (tailwindcss)
39
- id : cache-tailwindcss
40
- uses : actions/cache@v3
41
- with :
42
- path : node_modules
43
- key : nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tailwindcss
44
- restore-keys : |
45
- nodeModules-
36
+ # cache: 'npm'
37
+ #
38
+ # - name: Use cached node_modules (tailwindcss)
39
+ # id: cache-tailwindcss
40
+ # uses: actions/cache@v3
41
+ # with:
42
+ # path: node_modules
43
+ # key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tailwindcss
44
+ # restore-keys: |
45
+ # nodeModules-
46
46
47
47
- name : Install dependencies
48
- if : steps.cache-tailwindcss.outputs.cache-hit != 'true'
48
+ # if: steps.cache-tailwindcss.outputs.cache-hit != 'true'
49
49
run : npm install
50
50
env :
51
51
CI : true
Original file line number Diff line number Diff line change 26
26
uses : actions/setup-node@v3
27
27
with :
28
28
node-version : ${{ matrix.node-version }}
29
- # cache: 'npm'
30
-
29
+ # cache: 'npm'
30
+ #
31
31
# - name: Use cached node_modules
32
32
# id: cache
33
33
# uses: actions/cache@v3
Original file line number Diff line number Diff line change 23
23
with :
24
24
node-version : ${{ matrix.node-version }}
25
25
registry-url : ' https://registry.npmjs.org'
26
- # cache: 'npm'
27
-
26
+ # cache: 'npm'
27
+ #
28
28
# - name: Use cached node_modules
29
29
# id: cache
30
30
# uses: actions/cache@v3
Original file line number Diff line number Diff line change @@ -23,19 +23,19 @@ jobs:
23
23
with :
24
24
node-version : ${{ matrix.node-version }}
25
25
registry-url : ' https://registry.npmjs.org'
26
- cache : ' npm'
27
-
28
- - name : Use cached node_modules
29
- id : cache
30
- uses : actions/cache@v3
31
- with :
32
- path : node_modules
33
- key : nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
34
- restore-keys : |
35
- nodeModules-
26
+ # cache: 'npm'
27
+ #
28
+ # - name: Use cached node_modules
29
+ # id: cache
30
+ # uses: actions/cache@v3
31
+ # with:
32
+ # path: node_modules
33
+ # key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
34
+ # restore-keys: |
35
+ # nodeModules-
36
36
37
37
- name : Install dependencies
38
- if : steps.cache.outputs.cache-hit != 'true'
38
+ # if: steps.cache.outputs.cache-hit != 'true'
39
39
run : npm install
40
40
env :
41
41
CI : true
45
45
env :
46
46
CI : true
47
47
48
+ - name : Calculate tag
49
+ run : |
50
+ echo "tag_name=$(npm run calculate-tag-name --silent)" >> $GITHUB_ENV
51
+
48
52
- name : Publish
49
- run : npm publish
53
+ run : npm publish --tag ${{ env.tag_name }}
50
54
env :
51
55
CI : true
52
56
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 26
26
"posttest" : " npm run style" ,
27
27
"generate:plugin-list" : " node -r @swc/register scripts/create-plugin-list.js" ,
28
28
"generate:types" : " node -r @swc/register scripts/generate-types.js" ,
29
- "generate" : " npm run generate:plugin-list && npm run generate:types"
29
+ "generate" : " npm run generate:plugin-list && npm run generate:types" ,
30
+ "calculate-tag-name" : " node scripts/calculate-tag-name.js"
30
31
},
31
32
"files" : [
32
33
" src/*" ,
Original file line number Diff line number Diff line change
1
+ let version = process . env . npm_package_version || require ( '../package.json' ) . version
2
+
3
+ let match = / \d + \. \d + \. \d + - ( .* ) \. \d + / g. exec ( version )
4
+ if ( match ) {
5
+ console . log ( match [ 1 ] )
6
+ } else {
7
+ console . log ( 'latest' )
8
+ }
You can’t perform that action at this time.
0 commit comments