Skip to content

Commit

Permalink
Add 支持CI自动发布
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka-1314 committed Nov 30, 2024
1 parent ac2ac66 commit 1faffe9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/origin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 构建并上传小程序代码

on:
workflow_call:
secrets:
APPID:
required: true
KEY:
required: true

jobs:
upload:
runs-on: ubuntu-latest

steps:
- name: 检出代码
uses: actions/checkout@v4
with:
repository: misaka-org/Chaoxing-MiniProgram

- name: 安装 Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: 写入私钥
run: |
cd miniprogram
echo "${{ secrets.KEY }}" > ./private.${{ secrets.APPID }}.key
- name: 安装依赖
run: |
cd miniprogram
npm install --omit=dev --no-audit
npm install -g miniprogram-ci
- name: 执行小程序构建
run: |
cd miniprogram
miniprogram-ci pack-npm --pp ./ --pkp ./private.${{ secrets.APPID }}.key --appid ${{ secrets.APPID }}
miniprogram-ci upload --pp ./ --pkp ./private.${{ secrets.APPID }}.key --appid ${{ secrets.APPID }} --enable-es6 true -r 30
15 changes: 15 additions & 0 deletions .github/workflows/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 执行上传任务

on:
push:
branches:
- main
workflow_dispatch:

jobs:
call_workflow:
uses: misaka-org/Chaoxing-MiniProgram/.github/workflows/origin.yaml@main
secrets:
APPID: ${{ secrets.APPID }}
KEY: ${{ secrets.KEY }}

6 changes: 6 additions & 0 deletions miniprogram/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"tdesign-miniprogram": "^1.8.1",
"miniprogram-ci": "^2.0.10"
}
}

0 comments on commit 1faffe9

Please sign in to comment.