@@ -0,0 +1,41 @@
|
||||
name: WeChat Mini Program Preview
|
||||
description: Publish a WeChat Mini Program preview and generate a QR code.
|
||||
|
||||
inputs:
|
||||
project-path:
|
||||
description: Repository-relative directory containing project.config.json.
|
||||
required: true
|
||||
appid:
|
||||
description: WeChat Mini Program AppID.
|
||||
required: true
|
||||
robot:
|
||||
description: WeChat CI robot number from 1 to 30.
|
||||
required: false
|
||||
default: "1"
|
||||
private-key-path:
|
||||
description: Temporary code-upload key path.
|
||||
required: true
|
||||
qrcode-output:
|
||||
description: Destination PNG path.
|
||||
required: true
|
||||
version-label:
|
||||
description: Traceable commit or release label.
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Publish preview
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.project-path }}
|
||||
env:
|
||||
MINIAPP_APPID: ${{ inputs.appid }}
|
||||
MINIAPP_ROBOT: ${{ inputs.robot }}
|
||||
WECHAT_CI_PRIVATE_KEY_PATH: ${{ inputs.private-key-path }}
|
||||
MINIAPP_QR_OUTPUT: ${{ inputs.qrcode-output }}
|
||||
MINIAPP_VERSION_LABEL: ${{ inputs.version-label }}
|
||||
run: |
|
||||
temporary_script=".wechat-preview.cjs"
|
||||
cp "$GITHUB_ACTION_PATH/preview.cjs" "$temporary_script"
|
||||
trap 'rm -f "$temporary_script"' EXIT
|
||||
node "$temporary_script"
|
||||
Reference in New Issue
Block a user