File tree 1 file changed +17
-42
lines changed
1 file changed +17
-42
lines changed Original file line number Diff line number Diff line change 1
- # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name : Matrix Testing
5
-
1
+ name : Publish package to NPM
6
2
on :
7
- # push:
8
- # branches:
9
- # - main
10
- # - sandbox
11
- # - dev
12
-
13
- pull_request :
14
- branches :
15
- - main
16
- - sandbox
17
- - dev
3
+ release :
4
+ types : [created]
18
5
19
6
jobs :
20
- deploy :
7
+ build :
8
+ name : Publish to NPM
21
9
runs-on : ubuntu-latest
22
- strategy :
23
- matrix :
24
- node : ["16", "17"]
25
- name : Node ${{ matrix.node }} sample
26
10
steps :
27
- - name : Checkout
11
+ - name : Check out code from repository
28
12
uses : actions/checkout@v2
29
-
30
- - uses : actions/setup-node@v2
31
13
with :
32
- node-version : ${{ matrix.node }}
33
-
34
- # - name: Cache dependencies
35
- # id: cache-modules
36
- # uses: actions/cache@v2
37
- # with:
38
- # path: ~/.npm
39
- # key: npm-${{ hashFiles('package-lock.json') }}
40
- # restore-keys: npm-
41
-
42
- - name : NPM Install
43
- # if: steps.cache-modules.outputs.cache-hit != 'true'
44
- run : |
45
- npm install
14
+ ref : main
46
15
47
- - name : Run svelte-check
16
+ - name : Set Current Version
48
17
run : |
49
- npm run svelte-check
18
+ CURRENT_VERSION=${{ github.event.release.tag_name }}
19
+ echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
20
+ echo ${{ env.CURRENT_VERSION }}
50
21
51
- - name : Run jest
22
+ - name : Build and Publish
52
23
run : |
53
- npm run test
24
+ echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
25
+ npm i --no-save
26
+ lerna publish ${{ env.CURRENT_VERSION }} --force-publish --no-git-tag-version --yes
27
+ env :
28
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments