ngx-window-token #78
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-window-token | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'yarn' | |
registry-url: 'https://registry.npmjs.org' | |
always-auth: true | |
- uses: actions/cache@v3 | |
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 | |
- name: Build library | |
run: yarn build | |
- name: Publish library | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
yarn config set _authToken ${NODE_AUTH_TOKEN} | |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc && npm publish ./dist/ngx-window-token --access public --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
# - name: Publish to NPM | |
# if: github.event_name == 'workflow_dispatch' | |
# uses: JS-DevTools/npm-publish@v1 | |
# with: | |
# token: ${{ secrets.NPM_TOKEN }} | |
# package: dist/ngx-window-token/package.json | |
# access: public | |
# tag: next |