Skip to content

Commit 958ff8a

Browse files
IONOS(ci): Update Artifactory path structure to include version and SHA
Restructure Artifactory upload paths to include both NC version and commit SHA: Path Structure Changes: - For branches: <stage>/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip (e.g., dev/ncw-30.0.5/a1b2c3d/nextcloud-workspace-30.0.5.zip) - For PRs: dev/pr/nextcloud-workspace-pr-<number>.zip (unchanged) - Extract short SHA (first 7 characters) from commit SHA Benefits: - Each build gets a unique path based on both NC version and commit - Prevents accidental reuse of artifacts built from different commits - Makes it easier to identify and trace artifacts back to their source commit - Improves artifact organization and debugging capabilities Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
1 parent 0058474 commit 958ff8a

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

.github/workflows/build-artifact.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,12 +772,12 @@ jobs:
772772
id: artifactory_upload
773773
run: |
774774
# Artifactory Build Storage Structure:
775-
# | Branch/Event | Stage Prefix | Artifact Path |
776-
# |------------------|----------------|----------------------------------------------------|
777-
# | Pull Request | dev | dev/pr/nextcloud-workspace-pr-<number>.zip |
778-
# | ionos-dev | dev | dev/nextcloud-workspace-<ncVersion>.zip |
779-
# | ionos-stable | stable | stable/nextcloud-workspace-<ncVersion>.zip |
780-
# | rc/* | rc | rc/nextcloud-workspace-<ncVersion>.zip |
775+
# | Branch/Event | Stage Prefix | Artifact Path |
776+
# |------------------|----------------|--------------------------------------------------------------------------|
777+
# | Pull Request | dev | dev/pr/nextcloud-workspace-pr-<number>.zip |
778+
# | ionos-dev | dev | dev/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip |
779+
# | ionos-stable | stable | stable/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip |
780+
# | rc/* | rc | rc/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip |
781781
782782
ARTIFACTORY_STAGE_PREFIX="dev"
783783
@@ -790,10 +790,18 @@ jobs:
790790
fi
791791
792792
export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}"
793-
PATH_TO_FILE="pr/nextcloud-workspace-pr-${{ github.event.pull_request.number }}.zip"
794793
795-
if [ -z "${{ github.event.pull_request.number }}" ]; then
796-
PATH_TO_FILE="nextcloud-workspace-${{ needs.build-artifact.outputs.NC_VERSION }}.zip"
794+
# For PR: use simple pr/<number> path
795+
# For branches: use ncw-<version>/<sha>/ structure to ensure unique paths
796+
if [ -n "${{ github.event.pull_request.number }}" ]; then
797+
PATH_TO_FILE="pr/nextcloud-workspace-pr-${{ github.event.pull_request.number }}.zip"
798+
else
799+
# Extract short SHA (first 7 characters)
800+
SHORT_SHA="${{ github.sha }}"
801+
SHORT_SHA="${SHORT_SHA:0:7}"
802+
NC_VERSION="${{ needs.build-artifact.outputs.NC_VERSION }}"
803+
804+
PATH_TO_FILE="ncw-${NC_VERSION}/${SHORT_SHA}/nextcloud-workspace-${NC_VERSION}.zip"
797805
fi
798806
799807
export PATH_TO_LATEST_ARTIFACT="${PATH_TO_DIRECTORY}/${PATH_TO_FILE}"

0 commit comments

Comments
 (0)