Wechat applet multi-environment dynamic publishing method and device, equipment and medium
By combining configuration files and continuous integration scripts, automated deployment of WeChat Mini Programs in multiple environments has been achieved, solving the problems of cumbersome operation and error-proneness in existing technologies, improving development and operation efficiency, and reducing labor costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN YUNYIN DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
- Filing Date
- 2026-05-19
- Publication Date
- 2026-07-10
Smart Images

Figure CN122363728A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image recognition technology, specifically to a method, apparatus, device, and medium for dynamic publishing of WeChat mini programs in multiple environments. Background Technology
[0002] In the current software development environment, multi-branch development and multi-environment deployment place high demands on the management of mini-program deployments. Traditional methods require manually modifying the App-ID (Application Identifier) in the mini-program configuration file for different environments (such as testing, pre-production, and production), and manually uploading and publishing, which is cumbersome, error-prone, and has a long deployment cycle. Summary of the Invention
[0003] The purpose of this disclosure is to provide a method, apparatus, device, and medium for dynamic publishing of WeChat Mini Programs in multiple environments.
[0004] To achieve the above objectives, the first aspect of this disclosure provides a method for dynamic publishing of WeChat Mini Programs in multiple environments, the method comprising: Obtain configuration file sets and private key certificates corresponding to multiple different branch environments. The configuration file set includes multiple configuration files, each of which includes a mapping relationship between a set of mini program code and a set of WeChat mini program parameters. The branch environments included in each configuration file are different. The configuration file set and the private key certificate are packaged and compressed, and sent to the object storage server corresponding to the WeChat Mini Program platform; In response to receiving the target code to be uploaded on the code hosting platform, the target WeChat mini program parameter set corresponding to the target code is obtained from the object storage server; Based on the target code, modify the target configuration file corresponding to the target WeChat mini program parameter set, and transmit the target configuration file to the WeChat mini program publishing script based on the target private key corresponding to the target configuration file, so that the WeChat mini program publishing script publishes the mini program source code in the target configuration file to the WeChat mini program platform; Receive the upload notification result sent by the WeChat Mini Program platform.
[0005] Optionally, in some embodiments, obtaining the target WeChat mini-program parameter set corresponding to the target code from the object storage server includes: Determine the target branch environment corresponding to the target code; Obtain the target WeChat mini program parameter set corresponding to the target branch environment from the object storage server.
[0006] Optionally, in some embodiments, obtaining the target WeChat mini-program parameter set corresponding to the target branch environment from the object storage server includes: Send the branch name corresponding to the target branch environment to the object storage server; Receive the target configuration file sent by the object storage server; The target configuration file is parsed based on the branch name to obtain the target WeChat mini program. Optionally, in some embodiments, each WeChat mini program parameter set includes at least one of the following parameters: WeChat mini program identifier, mini program name, and runtime environment parameters.
[0007] Optionally, in some embodiments, the step of transmitting the target configuration file to the WeChat Mini Program publishing script based on the target private key corresponding to the target configuration file includes: Based on the target private key, the target configuration file is encrypted to generate an encrypted target configuration file; The encrypted target configuration file is transmitted to the WeChat mini program publishing script.
[0008] Optionally, in some embodiments, transmitting the encrypted target configuration file to the WeChat mini-program publishing script includes: The encrypted target configuration file is passed to the WeChat Mini Program publishing script through the Mini Program tool, so that the WeChat Mini Program publishing script publishes the Mini Program source code in the encrypted target configuration file to the WeChat Mini Program platform.
[0009] Optionally, in some embodiments, the method further includes: If it is determined that the target configuration file failed to upload based on the upload notification result, the target code is revised according to the upload notification result to generate revised code; Based on the revised code, a revision configuration file is generated and sent to the WeChat Mini Program platform.
[0010] According to a second aspect of this disclosure, a WeChat Mini Program multi-environment dynamic publishing device is provided, the device comprising: The first acquisition module is used to acquire configuration file sets and private key certificates corresponding to multiple different branch environments. The configuration file set includes multiple configuration files, each of which includes a mapping relationship between a set of mini program code and a set of WeChat mini program parameters. The branch environments included in each configuration file are different. The sending module is used to package and compress the configuration file set and the private key certificate, and send them to the object storage server corresponding to the WeChat Mini Program platform. The second acquisition module is used to, in response to receiving the target code to be uploaded on the code hosting platform, acquire the target WeChat mini program parameter set corresponding to the target code from the object storage server; The upload module is used to modify the target configuration file corresponding to the target WeChat mini program parameter set according to the target code, and transmit the target configuration file to the WeChat mini program publishing script according to the target private key corresponding to the target configuration file, so that the WeChat mini program publishing script publishes the mini program source code in the target configuration file to the WeChat mini program platform; The receiving module is used to receive the upload notification result sent by the WeChat Mini Program platform.
[0011] According to a third aspect of this disclosure, an electronic device is provided, comprising: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of the first aspects of this disclosure.
[0012] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any of the first aspects of this disclosure.
[0013] The above technical solution obtains configuration file sets and private key certificates corresponding to multiple different branch environments. Each configuration file set includes multiple configuration files, each containing a mapping relationship between a set of mini-program code and a WeChat mini-program parameter set. The branch environments included in each configuration file are different. The configuration file sets and private key certificates are packaged and compressed, and sent to the object storage server corresponding to the WeChat mini-program platform. Upon receiving the target code to be uploaded on the code hosting platform, the target WeChat mini-program parameter set corresponding to the target code is retrieved from the object storage server. Based on the target code, the target configuration file corresponding to the target WeChat mini-program parameter set is modified. Using the target private key corresponding to the target configuration file, the target configuration file is transmitted to the WeChat mini-program publishing script. The WeChat mini-program publishing script then publishes the mini-program source code in the target configuration file to the WeChat mini-program platform and receives the upload notification result from the WeChat mini-program platform. This automated code upload process simplifies the original multi-role, multi-stage manual collaboration into a streamlined operation, reducing the number of cross-role communications and coordination, and lowering the manual cost of code transmission in multiple environments.
[0014] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0015] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a method for dynamically publishing WeChat Mini Programs in multiple environments, according to an exemplary embodiment.
[0016] Figure 2 This is a block diagram illustrating a WeChat Mini Program multi-environment dynamic publishing device according to an exemplary embodiment.
[0017] Figure 3 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0018] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0019] In existing software development environments, multi-branch development and multi-environment deployment place high demands on the management of mini-program deployments. Current methods require manually modifying the App-ID in the mini-program configuration file for different environments (e.g., testing, pre-production, production), and manually completing uploads and releases, which presents the following problems: 1. In the existing mini-program release process, developers need to manually modify the App-ID in the project.config.json file for different environments (testing, pre-production, production), which is cumbersome and prone to errors.
[0020] 2. Chaotic multi-environment management: The same set of source code needs to correspond to multiple App-IDs. If it is maintained manually, it is easy to cause environment confusion, configuration overwriting or omission, which leads to cross-influence between test and production environments, increasing the maintenance difficulty and deployment risk.
[0021] 3. The upload process relies on manual labor: Uploading mini-programs depends on developers manually using local tools, which involves repetitive work, is inefficient, and cannot guarantee the stability and consistency of the upload process.
[0022] 4. Insecure credential management: Uploading to a mini-program requires a private key file corresponding to the App-ID. If it is managed and distributed manually, there is a risk of leakage or use of incorrect private keys, which may affect the normal release of the mini-program.
[0023] 5. Lack of automation and notification mechanisms: Existing methods fail to integrate effectively with continuous integration toolchains (CI / CD), cannot automatically complete builds and uploads after code submission, and lack real-time notification mechanisms, resulting in developers and testers being unable to keep abreast of the build and upload status.
[0024] 6. Long deployment cycle and high error rate: Since each deployment requires manual modification, execution and step-by-step verification, the entire mini-program deployment process is time-consuming. If an error occurs midway, the operation needs to be repeated, which further lengthens the deployment cycle and reduces development and maintenance efficiency.
[0025] In view of this, this embodiment proposes a configuration file-driven automated upload method for WeChat Mini Programs across multiple environments, addressing issues such as cumbersome manual modifications, inconvenient environment switching, complex credential management, and unstable upload processes in existing WeChat Mini Program release processes. This method employs a combination of configuration files and continuous integration scripts. Configuration files centrally manage WeChat Mini Program parameters corresponding to different branches, while continuous integration scripts dynamically parse and execute automated uploads, achieving automated multi-environment release of WeChat Mini Programs.
[0026] Figure 1 This is a flowchart illustrating a method for dynamically publishing WeChat Mini Programs across multiple environments, according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps: Step S110: Obtain configuration file sets and private key certificates corresponding to multiple different branch environments. The configuration file set includes multiple configuration files, each of which includes a mapping relationship between a set of mini program code and a set of WeChat mini program parameters. The branch environments included in each configuration file are different.
[0027] For example, this embodiment establishes a dynamic configuration and automated upload mechanism that can automatically match the App-ID, application name, and environment information of the WeChat Mini Program based on the code branch, and complete the Mini Program building and upload operations. Through this mechanism, the following application methods can be achieved: 1. Multi-branch and multi-environment management: For the same set of mini-program source code, different environments (test, pre-production, production and production backup) can be distinguished by branches. The system automatically identifies the branches and applies the corresponding configurations without the need for manual modification of configuration files.
[0028] 2. Automated build and upload: Dynamically update the App-ID in the mini-program's project.config.json based on the branch configuration, and call the mini-program CI tool to complete the build, NPM package processing and upload operations, achieving end-to-end automated deployment.
[0029] 3. Rapid Deployment and Risk Control: Through dynamic branch identification and automated processes, the deployment cycle of mini-programs can be significantly shortened, the risk of human error can be reduced, and the stability and efficiency of release can be improved.
[0030] 4. Scalability and Templated Applications: Based on the current system, it can be expanded to support the management of more branches and environments. In the future, other mobile applications or mini-program platforms (such as Alipay mini-programs) can be introduced as potential application areas, and similar automated deployment can be achieved by adjusting the configuration files and upload logic.
[0031] In summary, this embodiment is mainly applied to the multi-environment and branch automation management and upload process optimization of WeChat Mini Programs, which can improve development and operation efficiency, reduce launch risks, and has certain expansion potential, and can be applied to other similar mobile application platforms.
[0032] For example, in this embodiment, a Docker image required for GitLab CI runtime is created. The image is based on node:16.15.0, with the mc and yq commands installed. The mc command is configured to access the credentials required by the S3 object storage and its S3 server address. The base image installs the miniprogram-ci@2.0.10 npm package, which is the WeChat mini-program upload package.
[0033] Define a unified configuration file in the project root directory, using YAML format. The `config.yaml` configuration file contains the mapping relationships between multiple branch environments and WeChat Mini Program parameters. An example of its structure is as follows: app-ids: test: app-id: wx00000001; Name: All-Purpose Merchant Assistant; env: Test environment; release: app-id: wx00000002; Name: All-Purpose Merchant Assistant; env: pre-production environment; produce: app-id: wx00000003; Name: All-Purpose Merchant Assistant; env: production environment; produce_backups: app-id: wx00000004; Name: All-Purpose Merchant Manager; env: Production backup environment.
[0034] Among them, test, release, produce, and produce_backups are the corresponding Git branch names; the app-id field is used to store the unique identifier of the WeChat Mini Program; the name field is used to store the Mini Program name; and the env field is used to identify the runtime environment corresponding to this configuration.
[0035] This configuration file format enables centralized management of mini-program parameters under different environments, avoiding the need for manual modification in the code.
[0036] Step S120: Package and compress the configuration file set and private key certificate, and send them to the object storage server corresponding to the WeChat Mini Program platform.
[0037] For example, the private key certificate required for uploading to the WeChat Mini Program publishing platform should be named in the format of private{appId} key and saved in the key directory. The config.yaml file and the private key in the key directory should be packaged into a zip archive and uploaded to the S3 object storage server. The advantage of doing this is that if you need to add or remove publishing environments, you do not need to change the CI process; you only need to modify the files in the S3 storage.
[0038] Step S130: In response to receiving the target code to be uploaded on the code hosting platform, retrieve the target WeChat mini program parameter set corresponding to the target code from the object storage server.
[0039] For example, configure continuous integration rules in a code hosting platform (such as GitLab): when a developer commits code to a branch named test, release, produce, or produce_backups, the system will automatically trigger a build and upload task.
[0040] After triggering, use the `mc` command to download the zip file in s3, unzip the zip file, use the `yq` command to parse the yaml file, read the configuration file `config.yaml`, and parse out the corresponding `app-id`, `name`, and `env` parameters based on the branch name, which will be used as input for subsequent automated uploads.
[0041] Step S140: Modify the target configuration file corresponding to the target WeChat Mini Program parameter set according to the target code, and transfer the target configuration file to the WeChat Mini Program publishing script according to the target private key corresponding to the target configuration file, so that the Mini Program source code in the WeChat Mini Program publishing script publishes the target configuration file to the WeChat Mini Program platform.
[0042] For example, the app-id passed in from the previous step is used in the ci.js script. This continuous integration script will automatically modify the project.config.json file in the project root directory, updating the app-id field to the app-id corresponding to the current branch. Then, miniprogram-ci configures the Project object, which includes the following parameters: const project = new ci.Project( { appid, type: 'miniProgram', projectPath:path.resolve(process.cwd(), '.'), privateKeyPath,ignores: ['node_modules / / ', 'ci / / '], / / Ignore the ci directory and its subdirectories}).
[0043] Step S150: Receive the upload notification result sent by the WeChat Mini Program platform.
[0044] For example, the upload success notification result is as follows: v3wnshzs-produce_backups #52086 Mini Program push successful; commitId: 62c99f03; appId: wx00000004; Name: All-Purpose Merchant Manager; env: Production backup.
[0045] Among them, commitId is the git commit ID of the code uploaded to WeChat this time; appId: The name of the Git branch that triggered CI this time, and the corresponding appId in the configuration file; name: The name of the git branch that triggered CI this time, which corresponds to the name in the configuration file; env: The name of the git branch that triggered CI this time, which is the corresponding env in the configuration file.
[0046] In some embodiments, this embodiment also describes a process for dynamically publishing WeChat Mini Programs across multiple environments. The configuration file and private key are stored on an object storage server. GitLab triggers CI (Continuous Execution) after each code commit to a specific branch. CI downloads the configuration file and private key from the object storage server. The configuration file contains the branch name, the corresponding private key, and the Mini Program name. CI matches the private key based on the current branch name and then passes the private key to the WeChat Mini Program publishing JavaScript script, which is provided by WeChat. After the script executes, the WeChat Mini Program is published to the WeChat Mini Program platform. CI will then continue to send notifications to the WeChat Work group to inform the developers.
[0047] Through the above methods, this solution has the following beneficial effects: Automated environment management: By centrally managing the app-id, name, and runtime environment information of mini-programs under different environments through configuration files, developers can switch between multiple environments without repeatedly modifying the configuration in the code, avoiding upload failures caused by human oversight or misoperation.
[0048] Continuous integration without manual intervention: The system automatically triggers the upload process based on the continuous integration platform. The mini-program can be built and uploaded simply by submitting code to the specified branch, without the need for additional manual intervention, which greatly reduces the labor costs in the development and testing process.
[0049] Automatic private key file matching: A unified private key naming convention (private.{appid}.key) ensures a one-to-one correspondence between private key files and app-ids, avoiding the complex operation of manually selecting or replacing private key files and improving the accuracy and security of authentication. The upload process is highly efficient and stable: By integrating the miniprogram-ci tool, dependency packaging, code compression, re-signing, and uploading are completed automatically, ensuring that the uploaded package is consistent with the current code version, reducing repetitive build operations, and improving the stability and efficiency of the upload process.
[0050] Real-time feedback and error tracking: The execution results during the upload process are automatically pushed to the message notification system, including information such as project name, branch, commit number, AppID, and runtime environment; and an immediate alert is issued when the upload fails, making it easier for developers to quickly locate the problem and significantly shorten the troubleshooting time.
[0051] Reduced learning and usage costs: Developers and testers do not need to have in-depth knowledge of the details of uploading WeChat Mini Programs, nor do they need to manually configure, build, and upload operations. They only need to be familiar with the branch naming rules to participate in the work, thereby reducing the learning cost for personnel.
[0052] Improve collaboration and delivery efficiency: By automating processes, the original multi-role, multi-stage manual collaboration is simplified into a streamlined operation, reducing the number of cross-role communication and coordination, making the version iteration and delivery of mini-programs more efficient and smooth.
[0053] The above technical solution obtains configuration file sets and private key certificates corresponding to multiple different branch environments. Each configuration file set includes multiple configuration files, each containing a mapping relationship between a set of mini-program code and a WeChat mini-program parameter set. The branch environments included in each configuration file are different. The configuration file sets and private key certificates are packaged and compressed, and sent to the object storage server corresponding to the WeChat mini-program platform. Upon receiving the target code to be uploaded on the code hosting platform, the target WeChat mini-program parameter set corresponding to the target code is retrieved from the object storage server. Based on the target code, the target configuration file corresponding to the target WeChat mini-program parameter set is modified. Using the target private key corresponding to the target configuration file, the target configuration file is transmitted to the WeChat mini-program publishing script. The WeChat mini-program publishing script then publishes the mini-program source code in the target configuration file to the WeChat mini-program platform and receives the upload notification result from the WeChat mini-program platform. This automated code upload process simplifies the original multi-role, multi-stage manual collaboration into a streamlined operation, reducing the number of cross-role communications and coordination, and lowering the manual cost of code transmission in multiple environments.
[0054] Figure 2 This is a schematic diagram illustrating a WeChat Mini Program multi-environment dynamic publishing device according to an exemplary embodiment. For example... Figure 2 As shown, the device 100 includes: The first acquisition module 110 is used to acquire configuration file sets and private key certificates corresponding to multiple different branch environments. The configuration file set includes multiple configuration files, each of which includes a mapping relationship between a set of mini program code and a set of WeChat mini program parameters. The branch environments included in each configuration file are different. The sending module 120 is used to package and compress the configuration file set and the private key certificate, and send them to the object storage server corresponding to the WeChat Mini Program platform. The second acquisition module 130 is used to, in response to receiving the target code to be uploaded on the code hosting platform, acquire the target WeChat mini program parameter set corresponding to the target code from the object storage server; The upload module 140 is used to modify the target configuration file corresponding to the target WeChat mini program parameter set according to the target code, and transmit the target configuration file to the WeChat mini program publishing script according to the target private key corresponding to the target configuration file, so that the WeChat mini program publishing script publishes the mini program source code in the target configuration file to the WeChat mini program platform. The receiving module 150 is used to receive the upload notification results sent by the WeChat Mini Program platform.
[0055] Optionally, in some embodiments, the second acquisition module 130 includes: The submodule is used to determine the target branch environment corresponding to the target code; The acquisition submodule is used to obtain the target WeChat mini program parameter set corresponding to the target branch environment from the object storage server.
[0056] Optionally, in some embodiments, a submodule is obtained for: Send the branch name corresponding to the target branch environment to the object storage server; Receive the target configuration file sent by the object storage server; The target configuration file is parsed based on the branch name to obtain the target WeChat mini program parameter set.
[0057] Optionally, in some embodiments, each WeChat Mini Program parameter set includes at least one of the following parameters: WeChat Mini Program identifier, Mini Program name, and runtime environment parameters.
[0058] Optionally, in some embodiments, the upload module 140 includes: A generation submodule is used to encrypt the target configuration file based on the target private key to generate an encrypted target configuration file. The encryption submodule is used to upload the encrypted target configuration file to the WeChat mini program publishing script.
[0059] Optionally, in some embodiments, the encryption submodule is used for: By using the mini-program tool, the encrypted target configuration file is passed to the WeChat mini-program publishing script, which then publishes the mini-program source code in the encrypted target configuration file to the WeChat mini-program platform.
[0060] Optionally, in some embodiments, the device 100 further includes a revision module, which is used for: If it is determined that the target configuration file failed to upload based on the upload notification result, the target code is revised according to the upload notification result to generate revised code; Based on the revised code, a revision configuration file is generated and sent to the WeChat Mini Program platform.
[0061] The above technical solution obtains configuration file sets and private key certificates corresponding to multiple different branch environments. Each configuration file set includes multiple configuration files, each containing a mapping relationship between a set of mini-program code and a WeChat mini-program parameter set. The branch environments included in each configuration file are different. The configuration file sets and private key certificates are packaged and compressed, and sent to the object storage server corresponding to the WeChat mini-program platform. Upon receiving the target code to be uploaded on the code hosting platform, the target WeChat mini-program parameter set corresponding to the target code is retrieved from the object storage server. Based on the target code, the target configuration file corresponding to the target WeChat mini-program parameter set is modified. Using the target private key corresponding to the target configuration file, the target configuration file is transmitted to the WeChat mini-program publishing script, which then publishes the target configuration file to the WeChat mini-program platform and receives the upload notification result from the WeChat mini-program platform. This automated code upload process simplifies the original multi-role, multi-stage manual collaboration into a streamlined operation, reducing the number of cross-role communications and coordination, and lowering the manual cost of code transmission in multiple environments.
[0062] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0063] Figure 3 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Figure 3 As shown, the electronic device 300 may include a processor 301 and a memory 302. The electronic device 300 may also include one or more of a multimedia component 303, an input / output (I / O) interface 304, and a communication component 305.
[0064] The processor 301 controls the overall operation of the electronic device 300 to complete all or part of the steps in the WeChat Mini Program multi-environment dynamic publishing method described above. The memory 302 stores various types of data to support the operation of the electronic device 300. This data may include, for example, instructions for any application or method operating on the electronic device 300, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, disk, or optical disk. Multimedia component 303 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 302 or transmitted via communication component 305. The audio component also includes at least one speaker for outputting audio signals. I / O interface 304 provides an interface between processor 301 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 305 is used for wired or wireless communication between the electronic device 300 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of these. Therefore, the corresponding communication component 305 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0065] In an exemplary embodiment, the electronic device 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the aforementioned WeChat Mini Program multi-environment dynamic publishing method.
[0066] In another exemplary embodiment, a computer-readable storage medium is also provided, which includes program instructions that, when executed by a processor, implement the steps of the WeChat Mini Program multi-environment dynamic publishing method described above. For example, the computer-readable storage medium can be the memory 302 including the program instructions, which can be executed by the processor 301 of the electronic device 300 to complete the WeChat Mini Program multi-environment dynamic publishing method described above.
[0067] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the WeChat Mini Program multi-environment dynamic publishing method described above.
[0068] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0069] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction.
[0070] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A method for dynamically publishing WeChat mini-programs in multiple environments, characterized in that, The method includes: Obtain configuration file sets and private key certificates corresponding to multiple different branch environments. The configuration file set includes multiple configuration files, each of which includes a mapping relationship between a set of mini program code and a set of WeChat mini program parameters. The branch environments included in each configuration file are different. The configuration file set and the private key certificate are packaged and compressed, and sent to the object storage server corresponding to the WeChat Mini Program platform; In response to receiving the target code to be uploaded on the code hosting platform, the target WeChat mini program parameter set corresponding to the target code is obtained from the object storage server; Based on the target code, modify the target configuration file corresponding to the target WeChat mini program parameter set, and transmit the target configuration file to the WeChat mini program publishing script based on the target private key corresponding to the target configuration file, so that the WeChat mini program publishing script publishes the mini program source code in the target configuration file to the WeChat mini program platform; Receive the upload notification result sent by the WeChat Mini Program platform.
2. The WeChat Mini Program multi-environment dynamic publishing method according to claim 1, characterized in that, The step of obtaining the target WeChat mini-program parameter set corresponding to the target code from the object storage server includes: Determine the target branch environment corresponding to the target code; Obtain the target WeChat mini program parameter set corresponding to the target branch environment from the object storage server.
3. The WeChat Mini Program multi-environment dynamic publishing method according to claim 2, characterized in that, The step of obtaining the target WeChat mini-program parameter set corresponding to the target branch environment from the object storage server includes: Send the branch name corresponding to the target branch environment to the object storage server; Receive the target configuration file sent by the object storage server; The target configuration file is parsed based on the branch name to obtain the target WeChat mini program parameter set.
4. The WeChat Mini Program multi-environment dynamic publishing method according to any one of claims 1-3, characterized in that, Each WeChat Mini Program parameter set includes at least one of the following parameters: WeChat Mini Program identifier, Mini Program name, and runtime environment parameters.
5. The WeChat Mini Program multi-environment dynamic publishing method according to claim 4, characterized in that, The step of transmitting the target configuration file to the WeChat Mini Program publishing script based on the target private key corresponding to the target configuration file includes: Based on the target private key, the target configuration file is encrypted to generate an encrypted target configuration file; The encrypted target configuration file is transmitted to the WeChat mini program publishing script.
6. The WeChat Mini Program multi-environment dynamic publishing method according to claim 5, characterized in that, The step of transmitting the encrypted target configuration file to the WeChat mini-program publishing script includes: The encrypted target configuration file is passed to the WeChat Mini Program publishing script through the Mini Program tool, so that the WeChat Mini Program publishing script publishes the Mini Program source code in the encrypted target configuration file to the WeChat Mini Program platform.
7. The WeChat Mini Program multi-environment dynamic publishing method according to claim 1, characterized in that, The method further includes: If it is determined that the target configuration file failed to upload based on the upload notification result, the target code is revised according to the upload notification result to generate revised code; Based on the revised code, a revision configuration file is generated and sent to the WeChat Mini Program platform.
8. A WeChat Mini Program multi-environment dynamic publishing device, characterized in that, The device includes: The first acquisition module is used to acquire configuration file sets and private key certificates corresponding to multiple different branch environments. The configuration file set includes multiple configuration files, each of which includes a mapping relationship between a set of mini program code and a set of WeChat mini program parameters. The branch environments included in each configuration file are different. The sending module is used to package and compress the configuration file set and the private key certificate, and send them to the object storage server corresponding to the WeChat Mini Program platform. The second acquisition module is used to, in response to receiving the target code to be uploaded on the code hosting platform, acquire the target WeChat mini program parameter set corresponding to the target code from the object storage server; The upload module is used to modify the target configuration file corresponding to the target WeChat mini program parameter set according to the target code, and transmit the target configuration file to the WeChat mini program publishing script according to the target private key corresponding to the target configuration file, so that the WeChat mini program publishing script publishes the mini program source code in the target configuration file to the WeChat mini program platform; The receiving module is used to receive the upload notification result sent by the WeChat Mini Program platform.
9. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.