Operations 9 min read

How to Automate Multi‑Platform Mini‑Program Releases with Jenkins and Node.js

This article explains how to streamline the repetitive manual publishing of WeChat, Alipay, and Douyin mini‑programs by using Node.js tools, a unified configuration center, Jenkins pipelines, and DingTalk notifications to achieve one‑click, synchronized releases in under ten minutes.

Goodme Frontend Team
Goodme Frontend Team
Goodme Frontend Team
How to Automate Multi‑Platform Mini‑Program Releases with Jenkins and Node.js

Background and Pain Points

Manual release process repetition

Multiple platform configuration

WeChat, Alipay, Douyin each have separate back‑ends; each release requires logging in, setting version, uploading package, etc., which cannot be reused.

Version information sync

Version numbers and changelogs must be updated manually on each platform, leading to inconsistencies (e.g., WeChat v1.2.0 vs Alipay v1.1.9).

Efficiency bottlenecks and manpower consumption

Time cost

Statistics show manual release of three mini‑programs takes more than 30 minutes on average.

Team collaboration inefficiency

Reliance on specific members (e.g., “only one person can publish to Douyin”) creates a single‑point‑of‑failure risk.

Potential risks and business impact

High human error rate

Incorrect code package uploads.

Technical Selection

Core tool dependencies

WeChat: miniprogram-ci (https://www.npmjs.com/package/miniprogram-ci)

Alipay: minidev (https://www.npmjs.com/package/minidev)

Douyin: tt-ide-cli (https://www.npmjs.com/package/tt-ide-cli)

Development framework: Node.js Execution tool:

jenkins

Automation Script Design

Overall architecture

├── scripts/
│   ├── build/        # multi‑platform publish scripts
│   ├── config/       # platform‑specific configuration
│   ├── notify.js     # notification script
│   └── publish.js    # main workflow controller

Key module implementation

Configuration center

Unified version synchronization

Synchronize each platform’s version via the version field in package.json.

Platform configuration files

{
  "ciConfig": {
    "ddNotifyToken": "",
    "channelList": ["weapp","alipay","tt"],
    "tt": {
      "email": "",
      "password": "",
      "appid": "",
      "projectPath": "./dist/tt"
    },
    "alipay": {
      "appid": "",
      "toolId": "",
      "privateKey": "",
      "projectPath": "./dist/alipay"
    },
    "weapp": {
      "appid": "",
      "projectPath": "./dist/weapp",
      "privateKeyPath": "./config/weapp.key"
    }
  }
}

Upload logic

WeChat

const ci = require("miniprogram-ci");
const project = new ci.Project({
  appid: ciConfig.appid,
  type: "miniProgram",
  projectPath: ciConfig.projectPath,
  privateKeyPath: ciConfig.privateKeyPath,
  ignores: ["node_modules/**/*"]
});
// preview and upload steps...

Alipay

import { minidev } from "minidev";
// configure authentication, get preview QR code, upload, delete old versions...

Douyin

Douyin can automatically go online after audit.

- Keep three platforms consistent
- Avoid uncontrolled automatic releases
- Frequent releases may cause audit failures if previous version not approved
const tma = require("tt-ide-cli");
await tma.loginByEmail({ email: ciConfig.email, password: ciConfig.password });
await tma.upload({
  project: { path: ciConfig.projectPath },
  changeLog: desc,
  version,
  needUploadSourcemap: true,
  qrcode: { format: "imageFile", output: "./ttPreview.jpg", options: { small: false } }
});

Notification

Upload preview images to OSS and send DingTalk messages with version, changelog, and QR code.

const OSS = require("ali-oss");
const client = new OSS({ region: "", accessKeyId: "", accessKeySecret: "", bucket: "" });
// put function...
export const notify = async (props) => {
  // build DingTalk actionCard payload and post to robot API
};

Script Execution

Execution steps

Pull repository

Install dependencies

Build

Publish

Notify

Precautions

Do not clean the publish folder; keeping node_modules speeds up subsequent builds.

If machine resources allow, run three platform builds in parallel to improve efficiency.

stage('Compile') {
  parallel {
    stage('Alipay') { steps { sh '''
      echo "Alipay"
      yarn build alipay
      npm run kone-upload -- -c alipay
    ''' } }
    stage('Douyin') { steps { sh '''
      echo "Douyin"
      yarn build tt
      npm run kone-upload -- -c tt
    ''' } }
    stage('WeChat') { steps { sh '''
      echo "WeChat"
      yarn build weapp
      npm run kone-upload -- -c weapp
    ''' } }
  }
}

Running the Jenkins pipeline concurrently for the three platforms significantly reduces total release time.

Results

One‑click release without technical barriers.

Previously required a dedicated operator; now fully automated.

Release time reduced from over 30 minutes to under 10 minutes (Alipay slightly longer).

Version numbers are fully synchronized across platforms.

CI/CDAutomationdeploymentNode.jsmini-programmulti-platformJenkins
Goodme Frontend Team
Written by

Goodme Frontend Team

Regularly sharing the team's insights and expertise in the frontend field

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.