chore(release): 5.0.1 🎉 #49
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: publish | |
on: | |
push: | |
tags: | |
- 'v**' | |
defaults: | |
run: | |
shell: bash | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_VERSION: v0.0.0 | |
NPM_CACHE_DIR: ~/.npm | |
NPM_VERSION: 0.0.0 | |
jobs: | |
build: | |
name: ${{ matrix.os }} ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 120 | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
target: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# - name: Setup node@${{ matrix.target }} | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: ${{ matrix.target }} | |
# registry-url: 'https://registry.npmjs.org' | |
- name: List versions | |
run: | | |
echo "NODE_VERSION=$(node -v)" >> $GITHUB_ENV | |
echo "NPM_CACHE_DIR=$(npm config get cache)" >> $GITHUB_ENV | |
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_ENV | |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc | |
pwd | |
ls -la | |
which npm | |
npm config ls -l | |
- name: Cache dependencies | |
id: npm-cache | |
uses: actions/cache@v3 | |
with: | |
# See this glob workaround at https://github.com/actions/toolkit/issues/713. | |
path: | | |
${{ env.NPM_CACHE_DIR }}/* | |
!${{ env.NPM_CACHE_DIR }}/_npx | |
key: ${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ matrix.os }}-node-${{ env.NODE_VERSION }}-npm-${{ env.NPM_VERSION }} | |
- name: Install dependencies | |
run: | | |
npm pkg delete scripts.postinstall | |
npm ci | |
- name: Lint | |
run: | | |
npm run lint:build | |
- name: Build | |
run: | | |
npm run build | |
- name: Cleanup package.json | |
run: | | |
npm pkg delete devDependencies nano-staged scripts | |
- name: Publish to npm (Prerelease) | |
if: contains(github.ref, '-rc') == true || contains(github.ref, '-') == true | |
run: | | |
npm publish . --tag=next | |
- name: Publish to npm | |
if: contains(github.ref, '-rc') == false && contains(github.ref, '-') == false | |
run: | | |
npm publish . | |
# See https://github.com/actions/setup-node/issues/73. | |
# - name: Setup node@${{ matrix.target }} | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: ${{ matrix.target }} | |
# registry-url: 'https://npm.pkg.github.com/' | |
# scope: '@motss' | |
# - name: Publish to GPR (Prerelease) | |
# if: success() && contains(github.ref, '-') == true | |
# run: | | |
# npm config list | |
# npm publish . --tag=next | |
# - name: Publish to GPR (Prerelease) | |
# if: success() && contains(github.ref, '-') == false | |
# run: | | |
# npm config list | |
# npm publish . |