|
2 | 2 | # https://help.github.com/en/actions/automating-your-workflow-with-github-actions
|
3 | 3 | # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
|
4 | 4 | # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
|
| 5 | +# https://www.npmjs.com/package/@amanda-mitchell/semantic-release-npm-multiple |
5 | 6 |
|
6 | 7 | name: CI-CD
|
7 | 8 |
|
@@ -114,38 +115,29 @@ jobs:
|
114 | 115 | github-token: ${{ secrets.GITHUB_TOKEN }}
|
115 | 116 | parallel-finished: true
|
116 | 117 |
|
117 |
| - deploy: |
118 |
| - name: Publish to NPM |
119 |
| - if: github.ref == 'refs/heads/master' |
| 118 | + release: |
| 119 | + name: Release |
| 120 | + # removed to test beta branch. |
| 121 | + # if: github.ref == 'refs/heads/master' |
120 | 122 | runs-on: ubuntu-latest
|
121 | 123 | timeout-minutes: 10
|
122 | 124 | needs:
|
123 | 125 | - node_tests
|
124 | 126 | - browser_tests
|
125 |
| - |
126 | 127 | steps:
|
127 |
| - - name: Checkout source |
128 |
| - uses: actions/checkout@v2 |
129 |
| - |
130 |
| - - name: Install Node |
131 |
| - uses: actions/setup-node@v1 |
| 128 | + - uses: actions/checkout@v2 |
| 129 | + - uses: actions/setup-node@v1 |
| 130 | + with: |
| 131 | + node-version: 12 |
132 | 132 |
|
133 | 133 | - name: Install dependencies
|
134 | 134 | run: npm ci
|
135 | 135 |
|
136 |
| - - name: Publish to NPM |
137 |
| - uses: JS-DevTools/npm-publish@v1 |
138 |
| - with: |
139 |
| - token: ${{ secrets.NPM_TOKEN }} |
140 |
| - |
141 |
| - - name: Prepare the non-scoped packaged |
142 |
| - run: | |
143 |
| - cp LICENSE *.md dist |
144 |
| - VERSION=$(node -e "console.log(require('./package.json').version)") |
145 |
| - sed -i "s/X.X.X/${VERSION}/g" dist/package.json |
| 136 | + - name: Prepare Unscoped Package |
| 137 | + run: npm run build --if-present |
146 | 138 |
|
147 |
| - - name: Publish the non-scoped package to NPM |
148 |
| - uses: JS-DevTools/npm-publish@v1 |
149 |
| - with: |
150 |
| - token: ${{ secrets.NPM_TOKEN }} |
151 |
| - package: dist/package.json |
| 139 | + - name: Publish to NPM |
| 140 | + run: npx semantic-release |
| 141 | + env: |
| 142 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 143 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments