1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
name: js-sdsl CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Use node.js lts/Gallium
uses: actions/setup-node@v3
with:
node-version: lts/Gallium
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Run test
run: yarn test
- name: Save performance test result
uses: actions/upload-artifact@v3
with:
name: performance.md
path: dist/performance
- name: Coveralls report
uses: coverallsapp/github-action@master
with:
github-token: ${{ github.token }}
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Install dependencies
run: yarn install
- name: Download performance test result
uses: actions/download-artifact@v3
with:
name: performance.md
- name: Generate type documentation
run: yarn generate && mv README.md README.zh-CN.md performance.md docs/
- name: Deploy to github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
branch: gh-pages
publish:
needs: test
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'publish@') }}
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Publish to npm
run: yarn publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
release:
needs: test
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'publish@') }}
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Read package.json
uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
- name: Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: v${{ steps.package-version.outputs.version }}
release_name: v${{ steps.package-version.outputs.version }}
prerelease: false
|