doc: add git repo #24
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: build | |
on: [push, pull_request] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@master | |
with: | |
node-version: "20.2.0" | |
- name: Install dependencies | |
working-directory: ./lib | |
run: | | |
npm ci | |
npm run ropm-ci | |
npm run validate | |
npm-release: | |
#only run this task for version-tagged releases | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: ci | |
runs-on: ubuntu-latest | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- name: Set Release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@master | |
with: | |
node-version: "20.2.0" | |
- name: Copy README and LICENSE | |
run: cp README.md LICENSE lib | |
- name: Publish to npm | |
working-directory: ./lib | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ./.npmrc | |
npm version ${{env.RELEASE_VERSION}} --no-git-tag-version | |
npm publish --access public |