-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41477a5
commit 17a54c4
Showing
1 changed file
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,14 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: Release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-18.04] | ||
node: | ||
- 14 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -19,20 +26,14 @@ jobs: | |
# set up git since we will later push to the repo | ||
- run: git config --global user.name "GitHub CD bot" | ||
- run: git config --global user.email "[email protected]" | ||
# upgrade npm version in package.json to the tag used in the release. | ||
- run: npm version ${{ github.event.release.tag_name }} | ||
# build the project | ||
- run: npm run build | ||
- run: npm run build --workspaces | ||
# run tests just in case | ||
- run: npm test | ||
- run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" | ||
# publish to NPM -> there is one caveat, continue reading for the fix | ||
- run: npm run release --workspaces --if-present --tag ${{ github.event.release.target_commitish }} | ||
- run: npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" | ||
env: | ||
# Use a token to publish to NPM. See below for how to set it up | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# push the version changes to GitHub | ||
- run: git push | ||
env: | ||
# The secret is passed automatically. Nothing to configure. | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: npm whoami | ||
# publish to NPM -> there is one caveat, continue reading for the fix | ||
- run: npm publish --workspaces --access public |