chore: Update Node.js version and package manager in CI workflow #88
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: ngx-clipboard | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
isBeta: | |
description: 'Is this a beta release?' | |
required: false | |
default: 'false' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'yarn' | |
- uses: actions/cache@v4 | |
id: angular-cache | |
with: | |
path: | | |
.angular/cache | |
key: ${{ runner.os }}-ng-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}-ng | |
- name: Install dependencies | |
run: yarn --pure-lockfile --non-interactive --no-progress | |
# Fix linting errors first | |
# - name: Run TSLint | |
# run: yarn lint | |
- name: Run tests | |
run: yarn test --configuration=ci | |
- name: Build host app | |
run: yarn ng build library-host --configuration=production | |
- name: Build library | |
run: yarn build | |
- name: Publish library | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc && npm publish ./dist/lib --access public --tag ${{ github.event.inputs.isBeta == 'true' && 'next' || 'latest' }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |