@@ -3,9 +3,6 @@ name: Publish
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
- packageName :
7
- description : Which package to publish
8
- required : true
9
6
semanticVersion :
10
7
description : ' Semantic Version [major | minor | patch ]'
11
8
required : true
22
19
with :
23
20
token : ${{ secrets.ADMIN_TOKEN }}
24
21
ref : ' master'
22
+ # pulls all commits (needed for lerna / semantic release to correctly version)
23
+ fetch-depth : ' 0'
25
24
26
25
- uses : actions/setup-node@v1
27
26
with :
@@ -33,26 +32,21 @@ jobs:
33
32
git config --global user.name '@aspecto-system'
34
33
git config --global user.email '[email protected] '
35
34
36
- - name : Install node modules
37
- run : yarn --cwd packages/${{ github.event.inputs.packageName }}
35
+ - name : Install Packages
36
+ run : yarn install
38
37
39
- - name : Bump Version
38
+ - name : Authenticate with Registry
40
39
run : |
41
- yarn config set version-git-message "chore(release ${{ github.event.inputs.packageName }}) - publish v%s"
42
- yarn --cwd packages/${{ github.event.inputs.packageName }} version --${{ github.event.inputs.semanticVersion }} --no-commit-hooks
43
- node version-update.js ${{ github.event.inputs.packageName }}
44
-
45
- - name : Build
46
- run : yarn --cwd packages/${{ github.event.inputs.packageName }} build
47
-
48
- - name : Publish to NPM
49
- run : yarn --cwd packages/${{ github.event.inputs.packageName }} publish
40
+ yarn logout
41
+ echo "registry=http://registry.npmjs.org/" >> .npmrc
42
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
43
+ npm whoami
50
44
env :
51
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
45
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
52
46
53
- - name : Push Changes
47
+ - name : Publish package
54
48
run : |
55
- git add .
56
- git commit --amend --no-edit
57
- git push
49
+ yarn publish:ci ${{ github.event.inputs.semanticVersion }}
50
+ env :
51
+ GH_TOKEN : ${{ secrets.ADMIN_TOKEN }}
58
52
0 commit comments