Skip to content

Commit

Permalink
feat: 测试ci脚本构建
Browse files Browse the repository at this point in the history
feat: hack:增加微信dist产物自动化上传

fix: 更新ci监听branch
  • Loading branch information
HardenSG committed Mar 2, 2024
1 parent b7bd62f commit db7dbdc
Show file tree
Hide file tree
Showing 6 changed files with 7,194 additions and 17 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build weapp ci

on:
# 监听PUSH和PR
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
# 选择运行在ubuntu
runs-on: ubuntu-latest

# 配置下私有值
strategy:
matrix:
# 使用18.18.0版本
node-version: [18.18.0]

steps:
# 把代码checkout下来
- uses: actions/checkout@v2

# 安装node
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.5.1
with:
node-version: ${{ matrix.node-version }}

# 安装pnpm
- name: Install Pnpm
run: npm i -g pnpm

# 安装依赖
- name: Install Dependencies
run: pnpm i

# 安装upload Dependencies
- name: Install UploadDist Dependencies
run: pnpm uploadInstall

# 构建小程序
- name: Build weapp
run: pnpm build:weapp

# 从 secrets.UPLOAD_PRIVATE_KEY 生成私钥文件
# see Project/Settings/Secrets
- name: Generate private key for upload
run: echo "$UPLOAD_PRIVATE_KEY" > private.key
env:
UPLOAD_PRIVATE_KEY: ${{ secrets.UPLOAD_PRIVATE_KEY }}
# 上传代码
- name: Upload to WeChat
run: pnpm uploadDist
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "notifyBoard_C",
"version": "1.0.1",
"version": "0.9.12",
"private": true,
"description": "blog",
"description": "notifyBoard_C",
"templateInfo": {
"name": "default",
"typescript": true,
Expand All @@ -27,7 +27,9 @@
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch",
"release": "sh ./scripts/release.sh"
"release": "sh ./scripts/release.sh",
"uploadDist": "node ./scripts/uploadDist/upload.js",
"uploadInstall": "cd ./scripts/uploadDist && npm install"
},
"browserslist": [
"last 3 versions",
Expand Down Expand Up @@ -92,4 +94,4 @@
"resolutions": {
"@swc/core": "1.3.6"
}
}
}
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db7dbdc

Please sign in to comment.