Skip to content

Commit 2efca8f

Browse files
IONOS(ci): Update Artifactory path structure to include version and SHA
- Change path from flat structure to versioned hierarchy with SHA - For branches: use <stage>/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip - For PRs: keep simple dev/pr/nextcloud-workspace-pr-<number>.zip - Extract short SHA (first 7 characters) from commit SHA This ensures each build gets a unique path based on both NC version and commit, preventing accidental reuse of artifacts built from different commits with the same version number. Makes it easier to identify and trace artifacts back to their source commit. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
1 parent c895cc2 commit 2efca8f

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.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)