move npm publish to github action #6
Workflow file for this run
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
name: NodeJs Viron/lib Package CI | |
on: | |
pull_request: | |
types: [synchronize] | |
# push: | |
# branches: | |
# - develop | |
# paths: | |
# - "packages/nodejs/**" | |
# - "package.json" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Install dependencies and Build | |
run: | | |
echo "Installing packages..." | |
npm install --no-progress | |
npm run build -w packages/linter | |
npm run build -w packages/nodejs | |
- name: Set NPM_TOKEN | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Publish | |
run: | | |
echo "Publishing..." | |
npm publish -w packages/nodejs | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |