Skip to content

Commit 1f4bb38

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 471e711 commit 1f4bb38

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
@@ -763,12 +763,12 @@ jobs:
763763
id: artifactory_upload
764764
run: |
765765
# Artifactory Build Storage Structure:
766-
# | Branch/Event | Stage Prefix | Artifact Path |
767-
# |------------------|----------------|----------------------------------------------------|
768-
# | Pull Request | dev | dev/pr/nextcloud-workspace-pr-<number>.zip |
769-
# | ionos-dev | dev | dev/nextcloud-workspace-<ncVersion>.zip |
770-
# | ionos-stable | stable | stable/nextcloud-workspace-<ncVersion>.zip |
771-
# | rc/* | rc | rc/nextcloud-workspace-<ncVersion>.zip |
766+
# | Branch/Event | Stage Prefix | Artifact Path |
767+
# |------------------|----------------|--------------------------------------------------------------------------|
768+
# | Pull Request | dev | dev/pr/nextcloud-workspace-pr-<number>.zip |
769+
# | ionos-dev | dev | dev/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip |
770+
# | ionos-stable | stable | stable/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip |
771+
# | rc/* | rc | rc/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip |
772772
773773
ARTIFACTORY_STAGE_PREFIX="dev"
774774
@@ -781,10 +781,18 @@ jobs:
781781
fi
782782
783783
export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}"
784-
PATH_TO_FILE="pr/nextcloud-workspace-pr-${{ github.event.pull_request.number }}.zip"
785784
786-
if [ -z "${{ github.event.pull_request.number }}" ]; then
787-
PATH_TO_FILE="nextcloud-workspace-${{ needs.build-artifact.outputs.NC_VERSION }}.zip"
785+
# For PR: use simple pr/<number> path
786+
# For branches: use ncw-<version>/<sha>/ structure to ensure unique paths
787+
if [ -n "${{ github.event.pull_request.number }}" ]; then
788+
PATH_TO_FILE="pr/nextcloud-workspace-pr-${{ github.event.pull_request.number }}.zip"
789+
else
790+
# Extract short SHA (first 7 characters)
791+
SHORT_SHA="${{ github.sha }}"
792+
SHORT_SHA="${SHORT_SHA:0:7}"
793+
NC_VERSION="${{ needs.build-artifact.outputs.NC_VERSION }}"
794+
795+
PATH_TO_FILE="ncw-${NC_VERSION}/${SHORT_SHA}/nextcloud-workspace-${NC_VERSION}.zip"
788796
fi
789797
790798
export PATH_TO_LATEST_ARTIFACT="${PATH_TO_DIRECTORY}/${PATH_TO_FILE}"

0 commit comments

Comments
 (0)