Skip to content

Commit

Permalink
fix(ci): minor fixes to promote and release actions (#1339)
Browse files Browse the repository at this point in the history
* fix(ci): minor fixes to promote and release actions

* sync delivery release and promote
  • Loading branch information
tuntoja authored May 21, 2024
1 parent 879d2aa commit a04fa54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
7 changes: 0 additions & 7 deletions .github/actions/delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ runs:
exit 1
fi
# DEBUG
echo "[DEBUG] - Version: ${{ inputs.version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
echo "[DEBUG] - module_name: ${{ inputs.module_name }}"
echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}"
echo "[DEBUG] - release_type: ${{ inputs.release_type }}"
# Create ARCH dirs
mkdir noarch x86_64
Expand Down
16 changes: 8 additions & 8 deletions .github/actions/promote-to-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ runs:
echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
# Define ROOT_REPO_PATH for debian
# There is no cloud ROOT_REPO_PATH for debian, only onprem
# Should there be a need to deploy debian to cloud repositories, please use the same condition as RPM promotion
ROOT_REPO_PATH="apt-standard-${{ inputs.major_version }}"
echo "[DEBUG] - Get path of testing DEB packages to promote to stable."
SRC_PATHS=$(jf rt search --include-dirs apt-standard-${{ inputs.major_version }}-testing/pool/${{ inputs.module_name }}/*${{ inputs.major_version }}.${{ inputs.minor_version }}*${{ inputs.distrib }}*.deb | jq -r '.[].path')
SRC_PATHS=$(jf rt search --include-dirs "$ROOT_REPO_PATH-testing/pool/${{ inputs.module_name }}/*${{ inputs.distrib }}*.deb | jq -r '.[].path')
if [[ ${SRC_PATHS[@]} ]]; then
for SRC_PATH in ${SRC_PATHS[@]}; do
Expand All @@ -129,7 +134,7 @@ runs:
fi
echo "[DEBUG] - Build target path."
TARGET_PATH="apt-standard-${{ inputs.major_version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/"
TARGET_PATH="$ROOT_REPO_PATH-${{ inputs.stability }}/pool/${{ inputs.module_name }}/"
echo "[DEBUG] - Target path: $TARGET_PATH"
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
Expand All @@ -138,13 +143,8 @@ runs:
jf rt download $ARTIFACT --flat
done
for ARTIFACT_DL in $(dir|grep -E "*.deb"); do
for ARTIFACT_DL in $(dir -1|grep -E ".+${{ inputs.distrib }}.+\.deb"); do
ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1)
DISTRIB=$(echo $ARTIFACT_DL | cut -d '_' -f2 | cut -d '-' -f2)
if [[ "${{ inputs.distrib }}" != "$DISTRIB" ]]; then
echo "::error::Distrib [$DISTRIB] from package does not match distrib [${{ inputs.distrib }}] from input, abort promotion."
exit 1
fi
echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" --flat
done
Expand Down
13 changes: 8 additions & 5 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ runs:
declare -a PREVIOUS_STABLE_TAGS=()
SCOPE_VERSION="COLLECT"
MINOR_VERSION_FILE_PATH=".version"
RELEASE_CLOUD=0
# Get current stable branch name
# If MASTER, use root .version
# Else use branch name
if [[ "${{ inputs.github_ref_name }}" == "master" ]]; then
CURRENT_STABLE_BRANCH_MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2)
RELEASE_CLOUD=1
else
CURRENT_STABLE_BRANCH_MAJOR_VERSION=$(echo ${{ inputs.github_ref_name }} | cut -d '.' -f1,2)
RELEASE_CLOUD=0
fi
echo "Current stable branch major version: $CURRENT_STABLE_BRANCH_MAJOR_VERSION"
Expand All @@ -54,7 +57,11 @@ runs:
MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2)
MINOR_VERSION=$(grep -E "MINOR" .version | cut -d '=' -f2)
# Previous stable tags array
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION*" | head -n 1))
if [[ $RELEASE_CLOUD -eq 1 ]]; then
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.*-*" | head -n 1))
else
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.*" | grep -E "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.[0-9]+$" | head -n 1))
fi
# New stable tags array
TMP_STABLE_TAGS+=("$component-$MAJOR_VERSION.$MINOR_VERSION")
done
Expand Down Expand Up @@ -159,10 +166,6 @@ runs:
# Webhook url
JIRA_INCOMING_WEBHOOK="${{ inputs.jira_webhook_url }}"
# Call JIRA to provide new jira versions to create
# Webhook url
JIRA_INCOMING_WEBHOOK="${{ inputs.jira_webhook_url }}"
# Rebuild NEW_STABLE_TAGS as an array
for i in ${NEW_STABLE_TAGS[@]}; do
NEW_RELEASE_TAGS+=("$i")
Expand Down

2 comments on commit a04fa54

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
10 1 0 11 90.91 19m19.684133s

Failed Tests

Name Message ⏱️ Duration Suite
BENCH_1000STATUS AttributeError: 'NoneType' object has no attribute 'query_read_bytes' 85.397 s Bench

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
10 1 0 11 90.91 16m45.9166s

Failed Tests

Name Message ⏱️ Duration Suite
BENCH_10000STATUS AttributeError: 'NoneType' object has no attribute 'query_read_bytes' 86.091 s Bench

Please sign in to comment.