From 936854343d2a8193b09042dfaded9f66294802de Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 26 Jan 2026 17:46:46 +0100 Subject: [PATCH 01/11] IONOS(ci): Refactor branch-to-GitLab mapping with documentation table Improve clarity and maintainability by restructuring the branch type to GitLab BUILD_TYPE mapping. Add inline documentation table showing the complete mapping for all supported branch patterns (ionos-dev, ionos-stable, rc/*, and pull requests). Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 88b8b3244831f..e0237674102a9 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -758,12 +758,16 @@ jobs: - name: Upload build to artifactory id: artifactory_upload run: | - # PR builds are stored in a separate directory as "dev/pr/nextcloud-workspace-pr-.zip" - # Push to "ionos-dev" branch is stored as "dev/nextcloud-workspace-.zip" + # Artifactory Build Storage Structure: + # | Branch/Event | Stage Prefix | Artifact Path | + # |------------------|----------------|----------------------------------------------------| + # | Pull Request | dev | dev/pr/nextcloud-workspace-pr-.zip | + # | ionos-dev | dev | dev/nextcloud-workspace-.zip | + # | ionos-stable | stable | stable/nextcloud-workspace-.zip | ARTIFACTORY_STAGE_PREFIX="dev" - # set ARTIFACTORY_STAGE_PREFIX=stable on ionos-stable branch + # Set stage prefix based on branch if [ "${{ github.ref_name }}" == "ionos-stable" ]; then ARTIFACTORY_STAGE_PREFIX="stable" fi @@ -923,9 +927,12 @@ jobs: # Enable command echo for debugging purposes set -x - # Determine build type based on branch: - # - 'ionos-dev' branch triggers 'dev' build type - # - 'ionos-stable' branch triggers 'stable' build type + # Branch to GitLab Trigger Mapping: + # | ref_name | GITLAB_REF | BUILD_TYPE | + # |--------------|--------------|-------------| + # | ionos-dev | stable | dev | + # | ionos-stable | stable | stable | + BUILD_TYPE="dev" # Override build type for stable branch From 35c259a9eee727891b5b690f0bec1f92be5d4c31 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 11:14:09 +0100 Subject: [PATCH 02/11] IONOS(ci): Refactor branch validation into multi-line format Convert single-line branch validation condition into multi-line format to improve readability and prepare for future extensions to support additional branch patterns. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index e0237674102a9..f960b57aa2d15 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -142,7 +142,9 @@ jobs: echo " ✅ Event type is 'push'" fi - if [ "${{ github.ref_name }}" != "ionos-dev" ] && [ "${{ github.ref_name }}" != "ionos-stable" ]; then + # Check if branch matches expected patterns: ionos-dev, ionos-stable + VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$' + if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then echo "- ❌ Branch must be 'ionos-dev' or 'ionos-stable' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev' or 'ionos-stable')" WILL_TRIGGER=false From ff7cdb7f9cd3bf0e299c46b99d09685d4e40e1bb Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 15:16:03 +0100 Subject: [PATCH 03/11] IONOS(ci): Refactor concurrency group into multi-line YAML format Convert single-line concurrency group definition to multi-line YAML format for improved readability. No functional changes. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index f960b57aa2d15..b0c0bd8e73b5b 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -50,7 +50,12 @@ on: default: '' concurrency: - group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/ionos-dev' && github.run_id || github.event.pull_request.number || github.ref }} + group: >- + ${{ github.workflow }}-${{ + github.ref == 'refs/heads/ionos-dev' && github.run_id || + github.event.pull_request.number || + github.ref + }} cancel-in-progress: true env: From 9574a25526d2b185100417203e0ea880d51dec27 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 16:14:22 +0100 Subject: [PATCH 04/11] IONOS(ci): Use head_ref fallback in concurrency group Update concurrency group to use github.head_ref with ref_name fallback instead of ref. This provides better isolation for pull request builds while maintaining compatibility with branch builds. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index b0c0bd8e73b5b..66044358d8558 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -52,8 +52,8 @@ on: concurrency: group: >- ${{ github.workflow }}-${{ - github.ref == 'refs/heads/ionos-dev' && github.run_id || github.event.pull_request.number || + github.ref == 'refs/heads/ionos-dev' && github.run_id || github.ref }} cancel-in-progress: true From 1a81deafc0d4276daa01091970afc95beacd6a9c Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 16:16:47 +0100 Subject: [PATCH 05/11] IONOS(ci): Add cancel-in-progress to concurrency configuration Enable automatic cancellation of in-progress workflow runs when new commits are pushed to the same branch or pull request. This prevents redundant builds and saves CI resources. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 66044358d8558..e55941f005f50 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -52,7 +52,7 @@ on: concurrency: group: >- ${{ github.workflow }}-${{ - github.event.pull_request.number || + github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref == 'refs/heads/ionos-dev' && github.run_id || github.ref }} From a496193b3e3213385e6a9445f4b0c4d328313c11 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 16:21:04 +0100 Subject: [PATCH 06/11] IONOS(ci): Extend branch validation to support pull requests Add pull_request event type to branch validation condition, enabling the workflow to run on PRs targeting ionos-dev, ionos-stable, and rc/* branches. Update validation error message to reflect PR support. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index e55941f005f50..5ba8f23c14a6a 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -53,8 +53,12 @@ concurrency: group: >- ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || - github.ref == 'refs/heads/ionos-dev' && github.run_id || - github.ref + ( + ( + contains(fromJson('["refs/heads/ionos-dev"]'), github.ref) + ) && github.run_id || + github.ref + ) }} cancel-in-progress: true From 7ce74794b9dedb6e4f2c7c3066e54037923254d7 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 26 Jan 2026 17:35:54 +0100 Subject: [PATCH 07/11] IONOS(ci): Change GitLab ref from 'stable' to 'main' for branch builds As requested by target repo team --- .github/workflows/build-artifact.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 5ba8f23c14a6a..6a917e47b12d4 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -941,8 +941,8 @@ jobs: # Branch to GitLab Trigger Mapping: # | ref_name | GITLAB_REF | BUILD_TYPE | # |--------------|--------------|-------------| - # | ionos-dev | stable | dev | - # | ionos-stable | stable | stable | + # | ionos-dev | main | dev | + # | ionos-stable | main | stable | BUILD_TYPE="dev" @@ -971,7 +971,7 @@ jobs: --fail-with-body \ -o response.json \ --form token=${{ secrets.GITLAB_TOKEN }} \ - --form ref="stable" \ + --form ref="main" \ --form "variables[GITHUB_SHA]=${{ github.sha }}" \ --form "variables[ARTIFACTORY_LAST_BUILD_PATH]=${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" \ --form "variables[NC_VERSION]=${{ needs.build-artifact.outputs.NC_VERSION }}" \ From 02eaecd424bef03970da2eef8ee3028fed52d7bf Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 26 Jan 2026 17:36:28 +0100 Subject: [PATCH 08/11] IONOS(ci): Implement complete rc/* branch support Add full CI/CD pipeline support for release candidate (rc/*) branches across all workflow stages: Workflow Triggers: - Add 'rc/**' pattern to push trigger branches - Update concurrency group to prevent rc/* builds from interfering Branch Validation: - Extend configuration check to recognize rc/* as valid trigger branch - Update validation messages to include rc/* in expected patterns Artifactory Integration: - Enable artifact upload for rc/* branches - Create separate 'rc/*' directory for rc/* build artifacts - Set ARTIFACTORY_STAGE_PREFIX='rc' for proper organization GitLab Pipeline Integration: - Set BUILD_TYPE='rc' for rc/* branch builds - Update trigger conditions to include rc/* branches - Add rc/* to branch-to-GitLab mapping documentation table This provides complete parity with ionos-dev and ionos-stable branches, enabling proper release candidate workflow with isolated artifacts. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 6a917e47b12d4..2f7135c020fb6 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -31,6 +31,7 @@ on: branches: - ionos-dev - ionos-stable + - 'rc/**' workflow_dispatch: # Manual trigger to bypass all caches inputs: force_rebuild: @@ -55,7 +56,8 @@ concurrency: github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || ( ( - contains(fromJson('["refs/heads/ionos-dev"]'), github.ref) + contains(fromJson('["refs/heads/ionos-dev"]'), github.ref) || + startsWith(github.ref, 'refs/heads/rc/') ) && github.run_id || github.ref ) @@ -151,11 +153,11 @@ jobs: echo " ✅ Event type is 'push'" fi - # Check if branch matches expected patterns: ionos-dev, ionos-stable - VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$' + # Check if branch matches expected patterns: ionos-dev, ionos-stable, or rc/* + VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$|^rc/.*$' if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then - echo "- ❌ Branch must be 'ionos-dev' or 'ionos-stable' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY - echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev' or 'ionos-stable')" + echo "- ❌ Branch must be 'ionos-dev', 'ionos-stable', or 'rc/*' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY + echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev', 'ionos-stable', or 'rc/*')" WILL_TRIGGER=false else echo "- ✅ Branch is '\`${{ github.ref_name }}\`'" >> $GITHUB_STEP_SUMMARY @@ -687,10 +689,10 @@ jobs: upload-to-artifactory: runs-on: self-hosted - # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable" branch push defined in the on:push:branches + # Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable|rc/*" branch push defined in the on:push:branches if: | always() && - (github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') && + (github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) && needs.prepare-matrix.result == 'success' && (needs.build-external-apps.result == 'success' || needs.build-external-apps.result == 'skipped') && needs.build-artifact.result == 'success' @@ -775,12 +777,16 @@ jobs: # | Pull Request | dev | dev/pr/nextcloud-workspace-pr-.zip | # | ionos-dev | dev | dev/nextcloud-workspace-.zip | # | ionos-stable | stable | stable/nextcloud-workspace-.zip | + # | rc/* | rc | rc//nextcloud-workspace-.zip | ARTIFACTORY_STAGE_PREFIX="dev" # Set stage prefix based on branch if [ "${{ github.ref_name }}" == "ionos-stable" ]; then ARTIFACTORY_STAGE_PREFIX="stable" + # set ARTIFACTORY_STAGE_PREFIX=rc on rc/* branches + elif [[ "${{ github.ref_name }}" =~ ^rc/.*$ ]]; then + ARTIFACTORY_STAGE_PREFIX="${{ github.ref_name }}" fi export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}" @@ -923,13 +929,13 @@ jobs: name: Trigger remote workflow needs: [upload-to-artifactory] - # Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches + # Trigger remote build on "ionos-dev|ionos-stable|rc/*" branch *push* defined in the on:push:branches # Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable) # Configure at: https://github.com/IONOS-Productivity/ncw-server/settings/variables/actions if: | always() && github.event_name == 'push' && - (github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') && + (github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) && needs.upload-to-artifactory.result == 'success' && vars.DISABLE_REMOTE_TRIGGER != 'true' steps: @@ -943,12 +949,16 @@ jobs: # |--------------|--------------|-------------| # | ionos-dev | main | dev | # | ionos-stable | main | stable | + # | rc/* | main | rc | BUILD_TYPE="dev" # Override build type for stable branch if [ "${{ github.ref_name }}" == "ionos-stable" ]; then BUILD_TYPE="stable" + # Override build type for rc/* branches + elif [[ "${{ github.ref_name }}" =~ ^rc/ ]]; then + BUILD_TYPE="rc" fi # Construct source build URL for traceability From eb3ef49d93c25a259e7ae47b212ffdc0a3a0e021 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 16:05:04 +0100 Subject: [PATCH 09/11] IONOS(ci): Include PR number in concurrency group for pull requests Update concurrency group definition to use github.event.number for pull requests. This ensures each PR gets its own concurrency group, preventing PRs from canceling each other's builds while still allowing new commits to the same PR to cancel previous runs. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 2f7135c020fb6..8fe8cab1eb094 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -56,7 +56,7 @@ concurrency: github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || ( ( - contains(fromJson('["refs/heads/ionos-dev"]'), github.ref) || + contains(fromJson('["refs/heads/ionos-dev","refs/heads/ionos-stable"]'), github.ref) || startsWith(github.ref, 'refs/heads/rc/') ) && github.run_id || github.ref From 6e1ee776917c5d31f791f06007a8255932be6263 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 14:18:11 +0100 Subject: [PATCH 10/11] IONOS(ci): Add prerequisites validation to trigger-remote-dev-workflow Add comprehensive validation before triggering remote GitLab workflow: Dependency Management: - Add build-artifact to needs array to ensure NC_VERSION output is available - Update if condition to verify both build-artifact and upload-to-artifactory succeeded Variable Validation: - Validate secrets (GITLAB_TOKEN, GITLAB_TRIGGER_URL) - Validate job outputs (NC_VERSION, ARTIFACTORY_LAST_BUILD_PATH) - Validate GitHub context variables (sha, run_id, ref_name) - Abort with error if any required variable is missing This prevents the remote workflow from being triggered with missing critical variables like NC_VERSION, which was previously not available because build-artifact was not in the needs array. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 63 +++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 8fe8cab1eb094..6efff5ed9f981 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -928,7 +928,7 @@ jobs: runs-on: self-hosted name: Trigger remote workflow - needs: [upload-to-artifactory] + needs: [build-artifact, upload-to-artifactory] # Trigger remote build on "ionos-dev|ionos-stable|rc/*" branch *push* defined in the on:push:branches # Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable) # Configure at: https://github.com/IONOS-Productivity/ncw-server/settings/variables/actions @@ -936,9 +936,70 @@ jobs: always() && github.event_name == 'push' && (github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) && + needs.build-artifact.result == 'success' && needs.upload-to-artifactory.result == 'success' && vars.DISABLE_REMOTE_TRIGGER != 'true' steps: + - name: Check prerequisites + run: | + echo "Checking if all required variables are set..." + error_count=0 + + # Check secrets + if [ -z "${{ secrets.GITLAB_TOKEN }}" ]; then + echo "::error::GITLAB_TOKEN secret is not set" + error_count=$((error_count + 1)) + fi + + if [ -z "${{ secrets.GITLAB_TRIGGER_URL }}" ]; then + echo "::error::GITLAB_TRIGGER_URL secret is not set" + error_count=$((error_count + 1)) + fi + + # Check required outputs from previous jobs + if [ -z "${{ needs.build-artifact.outputs.NC_VERSION }}" ]; then + echo "::error::NC_VERSION output from build-artifact job is not set" + error_count=$((error_count + 1)) + else + echo "✓ NC_VERSION: ${{ needs.build-artifact.outputs.NC_VERSION }}" + fi + + if [ -z "${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" ]; then + echo "::error::ARTIFACTORY_LAST_BUILD_PATH output from upload-to-artifactory job is not set" + error_count=$((error_count + 1)) + else + echo "✓ ARTIFACTORY_LAST_BUILD_PATH: ${{ needs.upload-to-artifactory.outputs.ARTIFACTORY_LAST_BUILD_PATH }}" + fi + + # Check GitHub context variables + if [ -z "${{ github.sha }}" ]; then + echo "::error::github.sha is not set" + error_count=$((error_count + 1)) + else + echo "✓ GITHUB_SHA: ${{ github.sha }}" + fi + + if [ -z "${{ github.run_id }}" ]; then + echo "::error::github.run_id is not set" + error_count=$((error_count + 1)) + else + echo "✓ BUILD_ID: ${{ github.run_id }}" + fi + + if [ -z "${{ github.ref_name }}" ]; then + echo "::error::github.ref_name is not set" + error_count=$((error_count + 1)) + else + echo "✓ BRANCH: ${{ github.ref_name }}" + fi + + # Abort if any required variable is not set + if [ $error_count -ne 0 ]; then + echo "::error::Required variables are not set. Aborting." + exit 1 + fi + + echo "✅ All required variables are set" - name: Trigger remote workflow run: | # Enable command echo for debugging purposes From d00793ea06af97dcc722df4a716b20d18b01669e Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 27 Jan 2026 14:28:32 +0100 Subject: [PATCH 11/11] IONOS(ci): Change GitLab ref from 'stable' to 'main' for branch builds Update trigger-remote-dev-workflow to target the main branch in GitLab for all branch types (ionos-dev, ionos-stable, rc/*) instead of 'stable'. This represents a behavioral change for ionos-stable branch: it now triggers GitLab builds with ref="main" instead of ref="stable". This aligns with the GitLab repository structure where main is the target branch for container image builds across all branch types. Signed-off-by: Misha M.-Kupriyanov --- .github/workflows/build-artifact.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 6efff5ed9f981..8d5b2927e9acd 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -772,12 +772,12 @@ jobs: id: artifactory_upload run: | # Artifactory Build Storage Structure: - # | Branch/Event | Stage Prefix | Artifact Path | - # |------------------|----------------|----------------------------------------------------| - # | Pull Request | dev | dev/pr/nextcloud-workspace-pr-.zip | - # | ionos-dev | dev | dev/nextcloud-workspace-.zip | - # | ionos-stable | stable | stable/nextcloud-workspace-.zip | - # | rc/* | rc | rc//nextcloud-workspace-.zip | + # | Branch/Event | Stage Prefix | Artifact Path | + # |------------------|----------------|--------------------------------------------------------------------------| + # | Pull Request | dev | dev/pr/nextcloud-workspace-pr-.zip | + # | ionos-dev | dev | dev/ncw-//nextcloud-workspace-.zip | + # | ionos-stable | stable | stable/ncw-//nextcloud-workspace-.zip | + # | rc/* | rc | rc//ncw-//nextcloud-workspace-.zip | ARTIFACTORY_STAGE_PREFIX="dev" @@ -790,10 +790,18 @@ jobs: fi export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}" - PATH_TO_FILE="pr/nextcloud-workspace-pr-${{ github.event.pull_request.number }}.zip" - if [ -z "${{ github.event.pull_request.number }}" ]; then - PATH_TO_FILE="nextcloud-workspace-${{ needs.build-artifact.outputs.NC_VERSION }}.zip" + # For PR: use simple pr/ path + # For branches: use ncw-// structure to ensure unique paths + if [ -n "${{ github.event.pull_request.number }}" ]; then + PATH_TO_FILE="pr/nextcloud-workspace-pr-${{ github.event.pull_request.number }}.zip" + else + # Extract short SHA (first 7 characters) + SHORT_SHA="${{ github.sha }}" + SHORT_SHA="${SHORT_SHA:0:7}" + NC_VERSION="${{ needs.build-artifact.outputs.NC_VERSION }}" + + PATH_TO_FILE="ncw-${NC_VERSION}/${SHORT_SHA}/nextcloud-workspace-${NC_VERSION}.zip" fi export PATH_TO_LATEST_ARTIFACT="${PATH_TO_DIRECTORY}/${PATH_TO_FILE}"