MAT-7604: add case number (#232) #124
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: npm-publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
npm-publish: | |
name: npm-publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install node dependencies | |
run: npm ci | |
- name: Audit dependencies for security vulnerabilities | |
run: npm audit | |
- name: Lint the source code | |
run: npm run-script lint | |
- name: Build the source code | |
run: npm run build | |
- name: Execute test coverage | |
run: npm run-script coverage | |
- name: Publish if version has been updated | |
uses: pascalgn/npm-publish-action@master | |
with: # All of theses inputs are optional | |
tag_name: "v%s" | |
tag_message: "v%s" | |
commit_pattern: "[\\s\\S]*Release (\\S+)" | |
env: # More info about the environment variables in the README | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |