Skip to content

Commit

Permalink
chore: auto-release with semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
philsturgeon committed Jan 18, 2021
1 parent e274bf7 commit 990385e
Show file tree
Hide file tree
Showing 3 changed files with 3,872 additions and 581 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
# https://www.npmjs.com/package/@amanda-mitchell/semantic-release-npm-multiple

name: CI-CD

Expand Down Expand Up @@ -114,38 +115,28 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

deploy:
name: Publish to NPM
release:
name: Release
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- node_tests
- browser_tests

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Install Node
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm ci

- name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

- name: Prepare the non-scoped packaged
run: |
cp LICENSE *.md dist
VERSION=$(node -e "console.log(require('./package.json').version)")
sed -i "s/X.X.X/${VERSION}/g" dist/package.json
- name: Prepare Unscoped Package
run: npm run build --if-present

- name: Publish the non-scoped package to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: dist/package.json
- name: Publish to NPM
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit 990385e

Please sign in to comment.