From bbb10d547ee27b0702ab2c04e2396828c40d784d Mon Sep 17 00:00:00 2001 From: lin <102730463+bailin0824@users.noreply.github.com> Date: Wed, 14 May 2025 14:25:11 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E5=8E=BB=E9=99=A4=E7=82=B9?= =?UTF-8?q?=E5=87=BBXRFrame=E5=BC=B9=E7=AA=97=20(#170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 去除点击XRFrame弹窗 * feat: 删除弹窗代码 --------- Co-authored-by: v_guanglwen --- .../packageXRFrame/pages/index/index.js | 48 ------------------- .../packageXRFrame/pages/index/index.wxml | 2 +- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/miniprogram/packageXRFrame/pages/index/index.js b/miniprogram/packageXRFrame/pages/index/index.js index 04be2fe9..e2d2aa24 100644 --- a/miniprogram/packageXRFrame/pages/index/index.js +++ b/miniprogram/packageXRFrame/pages/index/index.js @@ -15,8 +15,6 @@ import '../../xr-custom/assets/effect-last-record-final' import list from './data/index' -let lastOpened = false -let lastCount = 0 let first = true Page({ @@ -52,7 +50,6 @@ Page({ } if (path === '/pages/scene-last-record/index') { - this.handleLastRecord() return } @@ -65,50 +62,5 @@ Page({ }, }) } - }, - async handleLastRecord() { - if (lastOpened) { - return - } - - lastCount += 1 - // if (Math.random() >= (0.34 + lastCount * 0.1)) { - // return; - // } - - const root = this.data.root - lastOpened = true - - wx.request({ - url: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/last-gate.txt', - success(res) { - wx.showModal({ - title: '一把钥匙', - content: res.data, - confirmText: '探寻真实', - cancelText: '放下钥匙', - success(res) { - if (res.cancel) { - wx.onAppShow((result) => { - lastOpened = false - }) - return - } - - wx.navigateTo({ - url: root + '/pages/scene-last-record/index', - success: () => { - wx.onAppShow((result) => { - lastOpened = false - }) - } - }) - } - }) - }, - fail(err) { - lastOpened = false - } - }) } }) diff --git a/miniprogram/packageXRFrame/pages/index/index.wxml b/miniprogram/packageXRFrame/pages/index/index.wxml index d4f07ce0..7a8cd563 100644 --- a/miniprogram/packageXRFrame/pages/index/index.wxml +++ b/miniprogram/packageXRFrame/pages/index/index.wxml @@ -1,6 +1,6 @@ - + XRFrame 小程序低成本高性能XR解决方案 From 543439ea7b6f38f3d3a88bbe38c6a34142b7b1e8 Mon Sep 17 00:00:00 2001 From: lin <102730463+bailin0824@users.noreply.github.com> Date: Wed, 14 May 2025 15:47:43 +0800 Subject: [PATCH 2/7] Feat miniprogram ci (#172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 修改miniprogram-ci * feat: 修改miniprogram-ci上传appid * feat: 修改node为ECMAScript模块 * feat: 测试 * feat: 测试 * feat: 测试 * feat: 修改workflows --------- Co-authored-by: v_guanglwen --- .github/workflows/ci.yml | 24 ++++++++++++++++++++---- .gitmodules | 2 +- build/ci.js | 32 +++++++++++++++++++++----------- package.json | 1 + 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f1f81b..01376cff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,35 @@ name: WeChat MiniProgram Demo CI/CD on: - push: - branches: - - master pull_request: + types: [closed] branches: - master jobs: upload: + if: github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo' runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: 'recursive' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Clone submodule + run: git submodule status + + - name: Install dependencies + run: npm install + + - name: Run package script + run: npm run init + - name: Upload MiniProgram env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | + mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key - node ./build/ci.js + chmod +x ./build/ci.js + node ./build/ci.js --skip-key-write diff --git a/.gitmodules b/.gitmodules index 2f398a69..6ccb8b5f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "miniprogram/packageSkylineExamples"] path = miniprogram/packageSkylineExamples - url = git@github.com:wechat-miniprogram/awesome-skyline.git + url = https://github.com/wechat-miniprogram/awesome-skyline.git diff --git a/build/ci.js b/build/ci.js index 9b78edc9..00c2998c 100644 --- a/build/ci.js +++ b/build/ci.js @@ -1,16 +1,22 @@ -const path = require('path') -const ci = require('miniprogram-ci') -const fs = require('fs') -const packageJson = require('../package.json') +import path from 'path' +import { fileURLToPath } from 'url' +import fs from 'fs' +import ci from 'miniprogram-ci' +import packageJson from '../package.json' with { type: 'json' } +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const privateKeyPath = path.resolve(__dirname, './key') -const privateKeyContent = process.env.WX_PRIVATE_KEY -if (!privateKeyContent) { - throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') +// 检查私钥文件是否已存在 +if (!fs.existsSync(privateKeyPath)) { + const privateKeyContent = process.env.WX_PRIVATE_KEY + if (!privateKeyContent) { + throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') + } + console.log('>>>>写入私钥文件:', privateKeyPath); + fs.writeFileSync(privateKeyPath, privateKeyContent) } -const privateKeyPath = path.resolve(__dirname, './private.key') -fs.writeFileSync(privateKeyPath, privateKeyContent) - const project = new ci.Project({ appid: 'wxe5f52902cf4de896', type: 'miniProgram', @@ -30,9 +36,11 @@ const params = { minifyWXML: true, minifyWXSS: true, codeProtect: false, - autoPrefixWXSS: true + autoPrefixWXSS: true, + ignoreUploadUnusedFiles: true }, } +await ci.packNpm(project, {}) ci.upload({ project, ...params @@ -45,3 +53,5 @@ ci.upload({ // 删除临时私钥文件 fs.unlinkSync(privateKeyPath) }) + + diff --git a/package.json b/package.json index 3330ab8e..5268c025 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "miniprogram-demo", "version": "1.0.0", "description": "WeChat miniprogram demo", + "type": "module", "scripts": { "init": "npm run sync && cd cloudfunctions/ && npm i --production && cd ../miniprogram/ && npm i --production", "lint": "eslint .", From 5193f541d617dba7013fedf0d793d6782406f608 Mon Sep 17 00:00:00 2001 From: wzy Date: Wed, 21 May 2025 15:12:13 +0800 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01376cff..8f22eb0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,13 +2,12 @@ name: WeChat MiniProgram Demo CI/CD on: pull_request: - types: [closed] branches: - - master + - feat-ce jobs: upload: - if: github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo' runs-on: ubuntu-latest + environment: PR_CI steps: - uses: actions/checkout@v4 with: @@ -16,20 +15,16 @@ jobs: submodules: 'recursive' token: ${{ secrets.GITHUB_TOKEN }} - - name: Clone submodule - run: git submodule status - - - name: Install dependencies - run: npm install - - - name: Run package script - run: npm run init - name: Upload MiniProgram env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | + # 验证密钥是否为空 + if [ -z "$WX_PRIVATE_KEY" ]; then + echo "❌ 错误: WX_PRIVATE_KEY 为空,请检查 GitHub Secrets 设置" + exit 1 + fi mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key - chmod +x ./build/ci.js - node ./build/ci.js --skip-key-write + echo "$WX_PRIVATE_KEY" | xxd \ No newline at end of file From fee66010ea6ee890e4ee2959e4f7017ea53062f8 Mon Sep 17 00:00:00 2001 From: wzy Date: Wed, 21 May 2025 15:14:21 +0800 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/ci.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/ci.js b/build/ci.js index 00c2998c..940428ec 100644 --- a/build/ci.js +++ b/build/ci.js @@ -9,6 +9,7 @@ const privateKeyPath = path.resolve(__dirname, './key') // 检查私钥文件是否已存在 if (!fs.existsSync(privateKeyPath)) { + console.log(); const privateKeyContent = process.env.WX_PRIVATE_KEY if (!privateKeyContent) { throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') From 895cf31ae65f559f11d677dce35a3539552dfb46 Mon Sep 17 00:00:00 2001 From: wzy Date: Wed, 21 May 2025 16:22:40 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=E4=BD=A0=E5=A5=BD=E4=B8=96?= =?UTF-8?q?=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/ci.js | 1 - 1 file changed, 1 deletion(-) diff --git a/build/ci.js b/build/ci.js index 940428ec..00c2998c 100644 --- a/build/ci.js +++ b/build/ci.js @@ -9,7 +9,6 @@ const privateKeyPath = path.resolve(__dirname, './key') // 检查私钥文件是否已存在 if (!fs.existsSync(privateKeyPath)) { - console.log(); const privateKeyContent = process.env.WX_PRIVATE_KEY if (!privateKeyContent) { throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets') From 9c031364d852d74f3705a56e8c60ddba97969e88 Mon Sep 17 00:00:00 2001 From: wzy Date: Mon, 26 May 2025 16:53:54 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-lint-check.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-lint-check.yml diff --git a/.github/workflows/pr-lint-check.yml b/.github/workflows/pr-lint-check.yml new file mode 100644 index 00000000..624684bf --- /dev/null +++ b/.github/workflows/pr-lint-check.yml @@ -0,0 +1,19 @@ +name: PR Lint Check + +on: + pull_request: + branches: feat-wzy-cs + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + - name: Install dependencies + run: npm install + - name: Run lint + run: npm run lint \ No newline at end of file From 2fd0bd85ff4911f19df7ac42594902967866bdd0 Mon Sep 17 00:00:00 2001 From: wzy Date: Tue, 27 May 2025 14:16:55 +0800 Subject: [PATCH 7/7] =?UTF-8?q?feat:=205-27=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js => .eslintrc.mjs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintrc.js => .eslintrc.mjs (100%) diff --git a/.eslintrc.js b/.eslintrc.mjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.mjs