Description
This topic describes how to create and share a public download link for a cloud build artifact with third-party platforms such as DingTalk, WeChat, or Lark.
Cause
By default, cloud build artifacts are private and cannot be shared through a public link.
Solutions
Prerequisite: In the Upload build artifact step, enable the Public option at the bottom of the page. This action exposes the artifact to the internet. Proceed only after you confirm that the artifact is secure.
Method 1
Obtain the artifact path from the upload artifact log.
In a subsequent custom script, obtain the build Job ID from the EMAS_PIPELINE_JOB_ID environment variable. Construct the download link in the following format: https://emas-devops-cdn.aliyuncs.com/job/<Build Job ID>/<Artifact Path>. For example: https://emas-devops-cdn.aliyuncs.com/job/$EMAS_PIPELINE_JOB_ID/apk/release/app-release-signed.apk
Method 2
Obtain the artifact path, as described in the first step of Method 1.
Obtain the ID of the upload artifact step.
In a subsequent step, use the context variable ${{ steps.<Upload artifact step ID>.outputs['<Artifact Path>'] }} to obtain the artifact's storage path. Prepend the EMAS accelerated domain name to complete the link. For example: https://emas-devops-cdn.aliyuncs.com/${{ steps.upload_artifact.outputs['apk/release/app-release-signed.apk'] }}
Applies to
Cloud Build