# This is a workflow for Continuous Integration (CI) for a VitePress project
name: 构建并上传到微信小程序-上传正式服
# Controls when the workflow will run
on:
# git tag uniapp-mp-1.0 && git push origin --tags
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# A workflow run consists of one or more jobs
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: read # 只读权限
actions: write # 写操作权限
# 在作业级别设置环境变量
# env:
# NODE_ENV: production
# CI: true
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks out your repository under $GITHUB_WORKSPACE, allowing access to the codebase
- name: 检查环境
uses: actions/checkout@v4
# Set up Node.js environment
- name: 安装Nodejs
uses: actions/setup-node@v4
with:
node-version: '20' # Specify the Node.js version to use
# cache: ${{ steps.detect-package-manager.outputs.manager }}
# 安装 pnpm
- name: 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
# Install project dependencies using pnpm
- name: 安装依赖
working-directory: uniapp
run: pnpm i
# Build the WeChat Mini Program
- name: 构建微信小程序
working-directory: uniapp
run: pnpm run build:mp-weixin
env:
NODE_ENV: production
CI: true
- name: 生成版本号
id: version
run: |
VERSION=$(date +%y-%m-%d)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Generated version: $VERSION"
- name: 上传到微信小程序
uses: seepine/action-miniprogram-ci@v1
with:
project-path: uniapp/dist/build/mp-weixin
private-key: ${{ secrets.WECHAT_MINI_UPLOAD_KEY }}
version: ${{ steps.version.outputs.version }}
desc: "prod"
robot: 12
{
"name": "uni-preset-vue",
"version": "0.0.0",
"scripts": {
"postinstall": "weapp-tw patch",
"dev:app": "uni -p app",
"dev:app-android": "uni -p app-android",
"dev:app-ios": "uni -p app-ios",
"dev:app-harmony": "uni -p app-harmony",
"dev:custom": "uni -p",
"dev:h5": "uni",
"dev:h5:ssr": "uni --ssr",
"dev:mp-alipay": "uni -p mp-alipay",
"dev:mp-baidu": "uni -p mp-baidu",
"dev:mp-jd": "uni -p mp-jd",
"dev:mp-kuaishou": "uni -p mp-kuaishou",
"dev:mp-lark": "uni -p mp-lark",
"dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao",
"dev:mp-weixin": "uni -p mp-weixin",
"dev:mp-xhs": "uni -p mp-xhs",
"dev:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
"build:app": " uni build -p app",
"build:app-android": " uni build -p app-android",
"build:app-ios": " uni build -p app-ios",
"build:app-harmony": " uni build -p app-harmony",
"build:custom": " uni build -p",
"build:h5": " uni build",
"build:h5:ssr": " uni build --ssr",
"build:mp-alipay": " uni build -p mp-alipay",
"build:mp-baidu": " uni build -p mp-baidu",
"build:mp-jd": " uni build -p mp-jd",
"build:mp-kuaishou": " uni build -p mp-kuaishou",
"build:mp-lark": " uni build -p mp-lark",
"build:mp-qq": " uni build -p mp-qq",
"build:mp-toutiao": " uni build -p mp-toutiao",
"build:mp-weixin": " uni build -p mp-weixin",
"build:mp-xhs": " uni build -p mp-xhs",
"build:quickapp-webview": " uni build -p quickapp-webview",
"build:quickapp-webview-huawei": " uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": " uni build -p quickapp-webview-union",
"type-check": "vue-tsc --noEmit",
"format": "prettier --write src/"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-4070620250821001",
"@dcloudio/uni-app-harmony": "3.0.0-4070620250821001",
"@dcloudio/uni-app-plus": "3.0.0-4070620250821001",
"@dcloudio/uni-components": "3.0.0-4070620250821001",
"@dcloudio/uni-h5": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-alipay": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-baidu": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-harmony": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-jd": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-lark": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-qq": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-toutiao": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-weixin": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-xhs": "3.0.0-4070620250821001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4070620250821001",
"@dcloudio/uni-ui": "^1.5.11",
"@weapp-tailwindcss/merge": "^1.2.3",
"dayjs": "^1.11.13",
"lodash-es": "^4.17.21",
"pinia": "^2.2.4",
"pinia-plugin-unistorage": "^0.1.2",
"prettier-plugin-organize-imports": "^4.2.0",
"prettier-plugin-tailwindcss": "^0.6.14",
"vconsole": "^3.15.1",
"vue": "^3.5.16",
"vue-i18n": "^9.14.2",
"weixin-js-sdk": "^1.6.5"
},
"devDependencies": {
"@dcloudio/types": "^3.4.14",
"@dcloudio/uni-automator": "3.0.0-4070620250821001",
"@dcloudio/uni-cli-shared": "3.0.0-4070620250821001",
"@dcloudio/uni-stacktracey": "3.0.0-4070620250821001",
"@dcloudio/vite-plugin-uni": "3.0.0-4070620250821001",
"@tailwindcss/postcss": "^4.1.13",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.7.4",
"@vue/runtime-core": "^3.5.21",
"@vue/tsconfig": "^0.8.1",
"autoprefixer": "^10.4.21",
"concurrently": "^9.2.1",
"postcss": "^8.5.3",
"prettier": "^3.0.0",
"sass": "^1.92.1",
"sass-loader": "10.1.1",
"tailwindcss": "^4.1.13",
"typescript": "^4.9.4",
"vite": "5.2.8",
"vue-tsc": "^2.2.10",
"weapp-ide-cli": "^3.1.0",
"weapp-tailwindcss": "^4.3.0"
}
}
融茂软件 (作者)
这个是编译过程出错,是编译到微信原生的过程
微信手敲不存在这个问题
2025-11-06 15:38