Skip to content

Commit ac829b8

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. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
1 parent 060f832 commit ac829b8

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

.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:
@@ -55,7 +56,8 @@ concurrency:
5556
github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) ||
5657
(
5758
(
58-
contains(fromJson('["refs/heads/ionos-dev"]'), github.ref)
59+
contains(fromJson('["refs/heads/ionos-dev"]'), github.ref) ||
60+
startsWith(github.ref, 'refs/heads/rc/')
5961
) && github.run_id ||
6062
github.ref
6163
)
@@ -151,11 +153,11 @@ jobs:
151153
echo " ✅ Event type is 'push'"
152154
fi
153155
154-
# Check if branch matches expected patterns: ionos-dev, ionos-stable
155-
VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$'
156+
# Check if branch matches expected patterns: ionos-dev, ionos-stable, or rc/*
157+
VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$|^rc/.*$'
156158
if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then
157-
echo "- ❌ Branch must be 'ionos-dev' or 'ionos-stable' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
158-
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev' or 'ionos-stable')"
159+
echo "- ❌ Branch must be 'ionos-dev', 'ionos-stable', or 'rc/*' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
160+
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev', 'ionos-stable', or 'rc/*')"
159161
WILL_TRIGGER=false
160162
else
161163
echo "- ✅ Branch is '\`${{ github.ref_name }}\`'" >> $GITHUB_STEP_SUMMARY
@@ -687,10 +689,10 @@ jobs:
687689
688690
upload-to-artifactory:
689691
runs-on: self-hosted
690-
# Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable" branch push defined in the on:push:branches
692+
# Upload the artifact to the Artifactory repository on PR *OR* on "ionos-dev|ionos-stable|rc/*" branch push defined in the on:push:branches
691693
if: |
692694
always() &&
693-
(github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') &&
695+
(github.event_name == 'pull_request' || github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) &&
694696
needs.prepare-matrix.result == 'success' &&
695697
(needs.build-external-apps.result == 'success' || needs.build-external-apps.result == 'skipped') &&
696698
needs.build-artifact.result == 'success'
@@ -775,12 +777,16 @@ jobs:
775777
# | Pull Request | dev | dev/pr/nextcloud-workspace-pr-<number>.zip |
776778
# | ionos-dev | dev | dev/nextcloud-workspace-<ncVersion>.zip |
777779
# | ionos-stable | stable | stable/nextcloud-workspace-<ncVersion>.zip |
780+
# | rc/* | rc | rc/nextcloud-workspace-<ncVersion>.zip |
778781
779782
ARTIFACTORY_STAGE_PREFIX="dev"
780783
781784
# Set stage prefix based on branch
782785
if [ "${{ github.ref_name }}" == "ionos-stable" ]; then
783786
ARTIFACTORY_STAGE_PREFIX="stable"
787+
# set ARTIFACTORY_STAGE_PREFIX=rc on rc/* branches
788+
elif [[ "${{ github.ref_name }}" =~ ^rc/ ]]; then
789+
ARTIFACTORY_STAGE_PREFIX="rc"
784790
fi
785791
786792
export PATH_TO_DIRECTORY="${{ env.ARTIFACTORY_REPOSITORY_SNAPSHOT }}/${ARTIFACTORY_STAGE_PREFIX}"
@@ -923,13 +929,13 @@ jobs:
923929

924930
name: Trigger remote workflow
925931
needs: [upload-to-artifactory]
926-
# Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches
932+
# Trigger remote build on "ionos-dev|ionos-stable|rc/*" branch *push* defined in the on:push:branches
927933
# Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable)
928934
# Configure at: https://github.com/IONOS-Productivity/ncw-server/settings/variables/actions
929935
if: |
930936
always() &&
931937
github.event_name == 'push' &&
932-
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') &&
938+
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' || startsWith(github.ref_name, 'rc/')) &&
933939
needs.upload-to-artifactory.result == 'success' &&
934940
vars.DISABLE_REMOTE_TRIGGER != 'true'
935941
steps:
@@ -943,12 +949,16 @@ jobs:
943949
# |--------------|--------------|-------------|
944950
# | ionos-dev | main | dev |
945951
# | ionos-stable | main | stable |
952+
# | rc/* | main | rc |
946953
947954
BUILD_TYPE="dev"
948955
949956
# Override build type for stable branch
950957
if [ "${{ github.ref_name }}" == "ionos-stable" ]; then
951958
BUILD_TYPE="stable"
959+
# Override build type for rc/* branches
960+
elif [[ "${{ github.ref_name }}" =~ ^rc/ ]]; then
961+
BUILD_TYPE="rc"
952962
fi
953963
954964
# Construct source build URL for traceability

0 commit comments

Comments
 (0)