🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@mario34/mp-ci

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mario34/mp-ci

小程序代码上传脚本,持续集成

Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

小程序代码上传 ci

⏱ 小程序持续集成 ci

快速配置

  • 安装开发依赖
yarn add @mario34/mp-ci -D
  • package.json添加配置
{
  "scripts": {
    "mp-ci": "mario34-mp-ci"
  },
  "mp-ci": {
    "appid": "小程序appid",
    "projectPath": "项目地址(相对process.cwd()目录的文件路径)",
    "keyType": "file"
  }
}
  • 在微信公众平台添加相关配置

登录微信公众平台,前往 开发=>开发管理=>开发设置=>小程序代码上传,生成上传密钥,开启了上传白名单的话需要把 CI 物理机的 ip 加入到 ip 白名单

config

参数描述类型默认值必填
appid小程序 appidstring/
projectPath上传代码路径string/
type显示指明当前的项目类型miniProgram/miniProgramPlugin/miniGame/miniGamePluginminiProgram
ignores排除的规则string[]['node_modules/**/*']
keyType密钥类型file/rawfile

cli 参数

需要规范化分支命名

  • --key: 上传密钥文件路径
  • --branch: 分支名称(分支名称将会被用作生成机器人号码)
release-* => ci 机器人 30
version-*.*.* => ci 机器人`${version.patch}`,patch为0时取27

持续集成

  • gitLab

在 CI/CD 设置中配置添加变量,这里需要的是路径,所以变量类型设置为file, 在 ci 脚本中添加 npm run mp-ci --key ${key_path} --branch ${CI_COMMIT_BRANCH}

  • github

在仓库settings/secrets/actions添加上传密钥,这里只能给添加文本类型的密钥,所以需要在 mp-ci 配置中添加"keyType": "raw",在 ci 脚本中添加 npm run mp-ci --key ${{ secrets.key }} --branch ${{GITHUB_REF##*/}}

Keywords

mini-program

FAQs

Package last updated on 19 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts