Update coverage.yml for Azure Pipelines #82
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
name: Checkout | |
- uses: actions/setup-node@v4 | |
name: Setup Node | |
with: | |
node-version: "20" | |
check-latest: true | |
cache: "npm" | |
- run: npm ci | |
name: Install | |
- run: npm run test:unit | |
name: Test | |
- run: npm run lint | |
name: Lint | |
- run: npm run build | |
name: Build | |
# - uses: JS-DevTools/npm-publish@v3 | |
# name: Publish to npm | |
# with: | |
# token: ${{ secrets.NPMJS_TOKEN }} | |
# registry: https://registry.npmjs.org/ | |
# - uses: JS-DevTools/npm-publish@v3 | |
# name: Publish to GitHub | |
# with: | |
# token: ${{ secrets.GH_TOKEN }} | |
# registry: https://npm.pkg.github.com | |
- name: Set git identity | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Publish | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: HUSKY_SKIP_HOOKS=1 npx lerna publish from-package --yes | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPMJS_TOKEN: ${{ secrets.NPMJS_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }} | |