2023-09-10 15:11:46 +08:00
|
|
|
|
name: build
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- master
|
|
|
|
|
- dev
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
task:
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
2023-09-10 19:19:28 +08:00
|
|
|
|
os: [windows-latest, macOS-latest, ubuntu-latest]
|
2024-03-02 11:22:22 +08:00
|
|
|
|
node-version: [16.x]
|
2023-09-10 15:11:46 +08:00
|
|
|
|
npm-client: [npm, yarn, pnpm]
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
|
if: matrix.npm-client == 'pnpm'
|
|
|
|
|
name: Install pnpm
|
|
|
|
|
with:
|
|
|
|
|
version: 7
|
|
|
|
|
run_install: false
|
|
|
|
|
|
|
|
|
|
- name: Set up Node.js ${{ matrix.node-version }}
|
2024-03-03 03:11:48 +08:00
|
|
|
|
uses: actions/setup-node@v4
|
2023-09-10 15:11:46 +08:00
|
|
|
|
with:
|
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
|
|
- name: Check out code
|
2024-03-02 23:20:47 +08:00
|
|
|
|
uses: actions/checkout@v4
|
2023-09-10 15:11:46 +08:00
|
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
run: ${{ matrix.npm-client }} install
|
|
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
|
run: ${{ matrix.npm-client }} run build
|
2023-09-10 15:24:48 +08:00
|
|
|
|
|
|
|
|
|
- name: Notify failure
|
|
|
|
|
if: ${{ failure() }}
|
|
|
|
|
env:
|
|
|
|
|
QYWX_ROBOT_URL: ${{ secrets.QYWX_ROBOT_URL }}
|
|
|
|
|
run: |
|
|
|
|
|
curl -H "Content-Type: application/json" -X POST -d '{
|
|
|
|
|
"msgtype": "text",
|
|
|
|
|
"text": {
|
|
|
|
|
"content": "UI 编译任务任务执行失败,请检查!https://github.com/pig-mesh/pig-ui"
|
|
|
|
|
}
|
|
|
|
|
}' $QYWX_ROBOT_URL
|