This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
Update release.yml #9
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: Create release | |
on: | |
push: | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Create release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install dependencies | |
run: npm install | |
- name: Run linting | |
run: npm run lint | |
- name: Build release artifact | |
run: npm run build | |
- name: Depcheck | |
uses: dependency-check/Dependency-Check_Action@main | |
id: Depcheck | |
with: | |
project: 'nhsuk.header-search' | |
path: '.' | |
format: 'HTML' | |
out: 'reports' | |
args: > | |
--failOnCVSS 7 | |
--nodePackageSkipDevDependencies | |
--nodeAuditSkipDevDependencies | |
- name: Upload OWAPS results | |
uses: actions/upload-artifact@master | |
with: | |
name: Depcheck report | |
path: ${{github.workspace}}/reports | |
- name: Get package version | |
if: startsWith(github.ref, 'refs/tags/*') | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} | |
- name: Publish NPM package | |
if: startsWith(github.ref, 'refs/tags/*') | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} | |