Skip to content

Commit 2583fb8

Browse files
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.
1 parent d815ef6 commit 2583fb8

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/build-artifact.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
branches:
3232
- ionos-dev
3333
- ionos-stable
34+
- 'rc/**'
3435
workflow_dispatch: # Manual trigger to bypass all caches
3536
inputs:
3637
force_rebuild:
@@ -50,7 +51,7 @@ on:
5051
default: ''
5152

5253
concurrency:
53-
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/ionos-dev' && github.run_id || github.event.pull_request.number || github.ref }}
54+
group: ${{ github.workflow }}-${{ (github.ref == 'refs/heads/ionos-dev' || startsWith(github.ref, 'refs/heads/rc/')) && github.run_id || github.event.pull_request.number || github.ref }}
5455
cancel-in-progress: true
5556

5657
env:
@@ -142,11 +143,12 @@ jobs:
142143
echo " ✅ Event type is 'push'"
143144
fi
144145
145-
# Check if branch matches expected patterns: ionos-dev, ionos-stable
146+
# Check if branch matches expected patterns: ionos-dev, ionos-stable, or rc/*
146147
if [ "${{ github.ref_name }}" != "ionos-dev" ] && \
147-
[ "${{ github.ref_name }}" != "ionos-stable" ]; then
148-
echo "- ❌ Branch must be 'ionos-dev' or 'ionos-stable' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
149-
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev' or 'ionos-stable')"
148+
[ "${{ github.ref_name }}" != "ionos-stable" ] && \
149+
[[ ! "${{ github.ref_name }}" =~ ^rc/ ]]; then
150+
echo "- ❌ Branch must be 'ionos-dev', 'ionos-stable', or 'rc/*' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
151+
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev', 'ionos-stable', or 'rc/*')"
150152
WILL_TRIGGER=false
151153
else
152154
echo "- ✅ Branch is '\`${{ github.ref_name }}\`'" >> $GITHUB_STEP_SUMMARY
@@ -678,10 +680,10 @@ jobs:
678680
679681
upload-to-artifactory:
680682
runs-on: self-hosted
681-
# Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable" branch push defined in the on:push:branches
683+
# Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable|rc/*" branch push defined in the on:push:branches
682684
if: |
683685
always() &&
684-
(github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') &&
686+
(github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) &&
685687
needs.prepare-matrix.result == 'success' &&
686688
(needs.build-external-apps.result == 'success' || needs.build-external-apps.result == 'skipped') &&
687689
needs.build-artifact.result == 'success'
@@ -766,12 +768,16 @@ jobs:
766768
# | Pull Request | dev | dev/pr/nextcloud-workspace-pr-<number>.zip |
767769
# | ionos-dev | dev | dev/nextcloud-workspace-<ncVersion>.zip |
768770
# | ionos-stable | stable | stable/nextcloud-workspace-<ncVersion>.zip |
771+
# | rc/* | rc | rc/nextcloud-workspace-<ncVersion>.zip |
769772
770773
ARTIFACTORY_STAGE_PREFIX="dev"
771774
772775
# Set stage prefix based on branch
773776
if [ "${{ github.ref_name }}" == "ionos-stable" ]; then
774777
ARTIFACTORY_STAGE_PREFIX="stable"
778+
# set ARTIFACTORY_STAGE_PREFIX=rc on rc/* branches
779+
elif [[ "${{ github.ref_name }}" == "rc/"* ]]; then
780+
ARTIFACTORY_STAGE_PREFIX="rc"
775781
fi
776782
777783
export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}"
@@ -914,13 +920,13 @@ jobs:
914920

915921
name: Trigger remote workflow
916922
needs: [upload-to-artifactory]
917-
# Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches
923+
# Trigger remote build on "ionos-dev|ionos-stable|rc/*" branch *push* defined in the on:push:branches
918924
# Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable)
919925
# Configure at: https://github.com/IONOS-Productivity/ncw-server/settings/variables/actions
920926
if: |
921927
always() &&
922928
github.event_name == 'push' &&
923-
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') &&
929+
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) &&
924930
needs.upload-to-artifactory.result == 'success' &&
925931
vars.DISABLE_REMOTE_TRIGGER != 'true'
926932
steps:
@@ -934,12 +940,16 @@ jobs:
934940
# |--------------|--------------|-------------|
935941
# | ionos-dev | main | dev |
936942
# | ionos-stable | main | stable |
943+
# | rc/* | main | rc |
937944
938945
BUILD_TYPE="dev"
939946
940947
# Override build type for stable branch
941948
if [ "${{ github.ref_name }}" == "ionos-stable" ]; then
942949
BUILD_TYPE="stable"
950+
# Override build type for rc/* branches
951+
elif [[ "${{ github.ref_name }}" == "rc/"* ]]; then
952+
BUILD_TYPE="rc"
943953
fi
944954
945955
# Construct source build URL for traceability

0 commit comments

Comments
 (0)