From 31f92a2ba9adaf444abcd3e8ef80dbeab462451d Mon Sep 17 00:00:00 2001 From: HardenSG <2767525216@qq.com> Date: Sat, 2 Mar 2024 14:56:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95ci=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..239d14b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: build weapp ci + +on: + # 监听PUSH和PR + push: + branches: [ main, feat-release-build-ci ] + 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 + + # 构建小程序 + - 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: npx mp-ci upload ./ --pkp=./private.key --no-test