Skip to content

Commit 8e6abd2

Browse files
feat(BUILD-4592): gh-action_release feat/jd/BUILD-4665-python-releasability
1 parent 2cc0560 commit 8e6abd2

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

.cirrus/burgr-notify-promotion

+14-22
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
set -euo pipefail
44

55
# Set the list of artifacts to display in BURGR
6-
#ARTIFACTS should exist in env and is a list of downloadable artifacts
7-
: "${ARTIFACTS?}"
6+
: "${ARTIFACTS?'parameter not set. This is a list of downloadable artifacts: <groupId>:<artifactId>:<extension>[:<classifier>],...'}"
87
: "${BUILD_NUMBER?}"
98
: "${BURGR_USERNAME?}" "${BURGR_PASSWORD?}" "${BURGR_URL?}"
109
: "${CIRRUS_REPO_OWNER?}" "${CIRRUS_REPO_NAME?}" "${CIRRUS_BUILD_ID?}"
1110

12-
#PROJECT_VERSION should exist in env set by set_maven_build_version in maven project calculated below for gradle projects
11+
# PROJECT_VERSION should exist in env set by set_maven_build_version in Maven project, it is calculated below for gradle projects
1312
if test -f gradle.properties; then
1413
PROJECT_VERSION=$(sed -ne 's/^version=//p' gradle.properties)
1514
if [[ "${PROJECT_VERSION}" == *"-SNAPSHOT" ]]; then
1615
PROJECT_VERSION=${PROJECT_VERSION%-SNAPSHOT}
17-
IFS="." read -r -a DIGITS <<< "$PROJECT_VERSION"
16+
IFS="." read -r -a DIGITS <<<"$PROJECT_VERSION"
1817
if [[ ${#DIGITS[@]} = 2 ]]; then
1918
PROJECT_VERSION=$PROJECT_VERSION.0
2019
fi
@@ -28,15 +27,14 @@ fi
2827

2928
# Create the URL of an artifact given a GAC (i.e. org.sonarsource.sonarqube:sonar-application:zip or com.sonarsource.sonarqube:sonarqube-enterprise:yguard:xml)
3029
function createArtifactURL() {
31-
ARTIFACT=$1
32-
IFS=":" read -r -a GAQE <<< "$ARTIFACT"
30+
IFS=":" read -r -a GAQE <<<"$1"
3331
GROUP_ID=${GAQE[0]}
3432
ARTIFACT_ID=${GAQE[1]}
3533
GROUP_ID_PATH=${GROUP_ID//./\/}
3634

3735
FILENAME=$ARTIFACT_ID-$PROJECT_VERSION
3836
EXTENSION=
39-
if [ ${#GAQE[@]} = 4 ];then
37+
if [ ${#GAQE[@]} = 4 ]; then
4038
CLASSIFIER=${GAQE[3]}
4139
EXTENSION=${GAQE[2]}
4240
FILENAME=$FILENAME-$CLASSIFIER
@@ -50,29 +48,23 @@ function createArtifactURL() {
5048

5149
# Create a comma-separated list of URLs of artifacts
5250
function createArtifactsURLS() {
53-
IFS="," read -r -a ARTIFACTS <<< "$1"
51+
IFS="," read -r -a artifacts <<<"$1"
5452
URLS=""
55-
if [ ${#ARTIFACTS[@]} = 1 ];then
56-
# shellcheck disable=SC2128
57-
URLS=$(createArtifactURL "$ARTIFACTS")
58-
else
59-
SEPARATOR=""
60-
for i in "${ARTIFACTS[@]}"; do
61-
URLS=$URLS$SEPARATOR$(createArtifactURL "$i")
62-
SEPARATOR=,
63-
done
64-
fi
53+
SEPARATOR=""
54+
for i in "${artifacts[@]}"; do
55+
URLS+=$SEPARATOR$(createArtifactURL "$i")
56+
SEPARATOR=,
57+
done
6558
echo "$URLS"
6659
}
6760

6861
URLS=
69-
# shellcheck disable=SC2128
7062
if [[ -n $ARTIFACTS ]]; then
7163
URLS=$(createArtifactsURLS "$ARTIFACTS")
7264
fi
7365

7466
BURGR_FILE=promote.burgr
75-
cat > $BURGR_FILE <<EOF
67+
cat >$BURGR_FILE <<EOF
7668
{
7769
"version":"$PROJECT_VERSION",
7870
"url":"$URLS",
@@ -83,6 +75,6 @@ echo "url ${BURGR_URL}/api/promote/${CIRRUS_REPO_OWNER}/${CIRRUS_REPO_NAME}/${CI
8375
{
8476
curl -sfSL -X POST -d @$BURGR_FILE -H "Content-Type:application/json" -u"${BURGR_USERNAME}:${BURGR_PASSWORD}" "${BURGR_URL}/api/promote/${CIRRUS_REPO_OWNER}/${CIRRUS_REPO_NAME}/${CIRRUS_BUILD_ID}"
8577
} || {
86-
echo "Burgr promotion notification failed with:"
87-
cat $BURGR_FILE
78+
echo "Burgr promotion notification failed with:"
79+
cat $BURGR_FILE
8880
}

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
permissions:
1616
id-token: write
1717
contents: write
18-
uses: SonarSource/gh-action_release/.github/workflows/main.yaml@master
18+
uses: SonarSource/gh-action_release/.github/workflows/main.yaml@feat/jd/BUILD-4665-python-releasability
1919
with:
2020
publishToPyPI: true
2121
publishToTestPyPI: true
22+
skipPythonReleasabilityChecks: true

0 commit comments

Comments
 (0)