Skip to content

Commit 990385e

Browse files
committed
chore: auto-release with semantic-release
1 parent e274bf7 commit 990385e

File tree

3 files changed

+3872
-581
lines changed

3 files changed

+3872
-581
lines changed

.github/workflows/CI-CD.yaml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
33
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
44
# 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
56

67
name: CI-CD
78

@@ -114,38 +115,28 @@ jobs:
114115
github-token: ${{ secrets.GITHUB_TOKEN }}
115116
parallel-finished: true
116117

117-
deploy:
118-
name: Publish to NPM
118+
release:
119+
name: Release
119120
if: github.ref == 'refs/heads/master'
120121
runs-on: ubuntu-latest
121122
timeout-minutes: 10
122123
needs:
123124
- node_tests
124125
- browser_tests
125-
126126
steps:
127-
- name: Checkout source
128-
uses: actions/checkout@v2
129-
130-
- name: Install Node
131-
uses: actions/setup-node@v1
127+
- uses: actions/checkout@v2
128+
- uses: actions/setup-node@v1
129+
with:
130+
node-version: 12
132131

133132
- name: Install dependencies
134133
run: npm ci
135134

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
135+
- name: Prepare Unscoped Package
136+
run: npm run build --if-present
146137

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
138+
- name: Publish to NPM
139+
run: npx semantic-release
140+
env:
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)