ci: use more descriptive names for published build artifacts (#33957)
Inefbbae5a4
, the `publish_packages_as_artifacts` CircleCI job was created to publish the build artifacts of PR builds on CI. Ina8f4f14bd
, its scope was expanded to also publish build artifacts on non-PR builds. The published artifacts names are constructed based on the PR number (e.g. include `-pr12345-`), so on non-PR builds the names do not reflect the source branch (instead, they include `-prfalse-`). This commit fixes this by using the current branch name. For example, artifact names for the `master` or `9.0.x` branch will include `-master-` and `-9.0.x-` respectively (instead of `-prfalse-`). (NOTE: For PRs, where branch name is `pull/12345`, the branch name is transformed to `pr12345`.) PR Close #33957
This commit is contained in:

committed by
Matias Niemelä

parent
971228b4f4
commit
99e68d0318
@ -2,11 +2,11 @@
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
readonly prNumber="$1"
|
||||
readonly prLastSha="${2:0:7}"
|
||||
readonly safeBranchName="$(echo $1 | sed 's/^pull\//pr/' | sed 's/[^A-Za-z0-9_.-]/_/g')"
|
||||
readonly shortLastSha="$(git rev-parse --short $2)"
|
||||
readonly inputDir="$PROJECT_ROOT/$3"
|
||||
readonly outputDir="$PROJECT_ROOT/$4"
|
||||
readonly fileSuffix="-pr$prNumber-$prLastSha.tgz"
|
||||
readonly fileSuffix="-$safeBranchName-$shortLastSha.tgz"
|
||||
|
||||
echo "Creating compressed archives for packages in '$inputDir'."
|
||||
|
||||
|
Reference in New Issue
Block a user