Skip to content

chore: add info about "saving" to an env var #15

chore: add info about "saving" to an env var

chore: add info about "saving" to an env var #15

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [16.x, 18.x]
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v3
# https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm test
publish:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_name == 'main' }}
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm run release -- --npm.skipChecks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}