Skip to content

fix: CourseContent type arg should have a default value #181

fix: CourseContent type arg should have a default value

fix: CourseContent type arg should have a default value #181

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@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build library
run: yarn build
- name: Build demo extension
run: yarn dev:build
- name: Show files to publish
run: npm publish --dry-run
- name: Upload built library
uses: actions/upload-artifact@v4
with:
name: thu-learn-lib
path: lib/
- name: Upload built demo extension
uses: actions/upload-artifact@v4
with:
name: thu-learn-lib-demo
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@v4
- name: Download build result
uses: actions/download-artifact@v4
with:
name: thu-learn-lib
path: lib/
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}