Bump semver from 6.3.0 to 6.3.1 #116
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 and Publish | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'ci skip')" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build library | |
run: yarn build | |
- name: Show files to publish | |
run: npm publish --dry-run | |
- name: Upload build result | |
uses: actions/upload-artifact@v3 | |
with: | |
name: thu-learn-lib | |
path: lib/ | |
- name: Build bundled | |
run: yarn build-dist | |
- name: Upload bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: thu-learn-lib-bundled | |
path: dist/ | |
publish-to-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download build result | |
uses: actions/download-artifact@v3 | |
with: | |
name: thu-learn-lib | |
path: lib/ | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish to NPM | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
# publish-to-github: | |
# needs: build | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: read | |
# packages: write | |
# if: "startsWith(github.ref, 'refs/tags/v')" | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Download build result | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: thu-learn-lib | |
# path: lib/ | |
# - run: rm -rf ~/.npmrc | |
# - uses: actions/setup-node@v2 | |
# with: | |
# registry-url: 'https://npm.pkg.github.com' | |
# - name: Publish to GitHub Package Registry | |
# run: npm publish | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |