diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b470e00..7802b658 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,8 @@ workflows: - macos-job: name: CocoaPods cocoapods: true + - verify_branch: + name: Verify branch notify_release: jobs: - notify_release: @@ -168,3 +170,24 @@ jobs: } ] } + verify_branch: + docker: + - image: cimg/base:stable + resource_class: small + steps: + - run: + name: Verify version + command: | + echo "We check branch here instead of running job with filter because we need to run it on every PR to make job mandatory in GH." + if [[ ${CIRCLE_BRANCH} == release* ]]; then + VERSION=$(echo "${CIRCLE_BRANCH}" | sed -E "s/^release[\/-]v//") + MAJOR=$(echo "${VERSION}" | cut -d. -f1) + MINOR=$(echo "${VERSION}" | cut -d. -f2) + echo "Version: ${VERSION} MAJOR: ${MAJOR} MINOR: ${MINOR}" + if [[ "${MAJOR}" -eq 24 ]]; then + if [[ "${MINOR}" -lt 6 ]]; then + echo "Version ${VERSION} is not allowed to be released from the main branch because of incorrect dependencies in SPM. Please use lts branch (see lts/v24.5 for example)." + exit 1 + fi + fi + fi \ No newline at end of file