From 841baa6eda2c9268037a4fd95fef972d44f77109 Mon Sep 17 00:00:00 2001 From: tuntoja <58987095+tuntoja@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:36:19 +0200 Subject: [PATCH 1/3] =?UTF-8?q?enh(promote):=20handle=20debian=20package?= =?UTF-8?q?=20promotion=20for=20multiple=20distributi=E2=80=A6=20(#5005)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: May <110405507+paul-oureib@users.noreply.github.com> --- .github/actions/promote-to-stable/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml index 9cb76256a..59bfa01d5 100644 --- a/.github/actions/promote-to-stable/action.yml +++ b/.github/actions/promote-to-stable/action.yml @@ -62,10 +62,13 @@ runs: - name: Promote DEB package to stable if: ${{ contains(fromJSON('["bullseye", "bookworm"]'), inputs.distrib) }} run: | + set -eux + echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" + echo "[DEBUG] - Distrib: ${{ inputs.module }}" echo "[DEBUG] - Get path of testing DEB packages to promote to stable." - SRC_PATHS=$(jf rt s --include-dirs apt-plugins-testing/pool/${{ inputs.module }}/*.deb | jq -r '.[].path') + SRC_PATHS=$(jf rt search --include-dirs apt-plugins-testing/pool/${{ inputs.module }}/*${{ inputs.distrib }}*.deb | jq -r '.[].path') if [[ ${SRC_PATHS[@]} ]]; then for SRC_PATH in ${SRC_PATHS[@]}; do @@ -88,6 +91,11 @@ runs: for ARTIFACT_DL in $(dir|grep -E "*.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, aborting 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" done From b1739be53c77875782a2b6a7717e6d7c49993eb3 Mon Sep 17 00:00:00 2001 From: tuntoja <58987095+tuntoja@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:56:21 +0200 Subject: [PATCH 2/3] fix(promote): fix pattern used for promote upload (#5007) --- .github/actions/promote-to-stable/action.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml index 59bfa01d5..105085cba 100644 --- a/.github/actions/promote-to-stable/action.yml +++ b/.github/actions/promote-to-stable/action.yml @@ -89,13 +89,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, aborting 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" done From 6e71b9082295a1009f8c72317ece8dcbd9b1ceac Mon Sep 17 00:00:00 2001 From: tuntoja <58987095+tuntoja@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:42:06 +0200 Subject: [PATCH 3/3] fix(promote): fix pattern for debian promote (#5010) --- .github/actions/promote-to-stable/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml index 105085cba..0309e7677 100644 --- a/.github/actions/promote-to-stable/action.yml +++ b/.github/actions/promote-to-stable/action.yml @@ -89,7 +89,7 @@ runs: jf rt download $ARTIFACT --flat done - for ARTIFACT_DL in $(dir -1|grep -E "*${{ inputs.distrib }}*.deb"); do + for ARTIFACT_DL in $(dir -1|grep -E ".+${{ inputs.distrib }}.+\.deb"); do ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1) echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH." jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH"