-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out deploy to npm as separate workflow (#232)
- Loading branch information
1 parent
af89583
commit d253c97
Showing
2 changed files
with
39 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Deploy to npm | ||
|
||
# MANUAL execution only | ||
# | ||
# Also runs the full set of tests, with all Node + TypeScript versions. | ||
|
||
jobs: | ||
build: | ||
environment: prod | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x, 16.x, 18.x] | ||
# TODO - add 20.x when it is released | ||
typescript-version: [3, 4] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} and TypeScript ${{ matrix.typescript-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
# npm ci - for a clean install, fails safe | ||
- run: npm ci | ||
- run: npm install --development ${{ matrix.typescript-version }} | ||
- run: npm test | ||
# only deploy to npmjs, if this is master AND this is one particular build (we only want to deploy once!) | ||
- name: Deploy | ||
if: github.ref == 'refs/heads/master' && matrix.node-version == '16.x' && matrix.typescript-version == '4' | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# - name: Report Code Coverage | ||
# if: matrix.node-version == '16.x' && matrix.typescript-version == 4 | ||
# run: npm run report-coverage-to-coveralls |
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