diff --git a/.github/workflows/swift-toolchain.yml b/.github/workflows/swift-toolchain.yml index 8011be244..3c1703942 100644 --- a/.github/workflows/swift-toolchain.yml +++ b/.github/workflows/swift-toolchain.yml @@ -74,8 +74,18 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get -qq -o Dpkg::Use-Pty=0 install -yq repo libxml2-utils # Which branch is this workflow based on +<<<<<<< HEAD branch_version=main if [[ "$branch_version" == "main" ]] ; then +======= + branch_version_string=${{ github.event.inputs.swift_version || '0.0.0' }} + if echo "$branch_version_string" | grep '\.'; then + branch_version="$(echo "$branch_version_string" | cut -d '.' -f 1).$(echo "$branch_version_string" | cut -d '.' -f 2)" + else + branch_version="$branch_version_string" + fi + if [[ "$branch_version" == "0.0" ]] ; then +>>>>>>> 926d11a (github swift-toolchain workflow: use a release-specific release tag name when a non-main branch is built) branch_name="main" else branch_name="release/${branch_version}" @@ -144,7 +154,11 @@ jobs: if [[ -n "${{ github.event.inputs.swift_tag }}" ]] ; then echo swift_tag=${{ github.event.inputs.swift_tag }} | tee -a ${GITHUB_OUTPUT} else +<<<<<<< HEAD if [[ "$branch_version" == "main" ]] ; then +======= + if [[ "$branch_name" == "main" ]] ; then +>>>>>>> 926d11a (github swift-toolchain workflow: use a release-specific release tag name when a non-main branch is built) echo swift_tag=$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT} else echo swift_tag=swift-"$branch_version"-$(date +%Y%m%d.$(date +%-H/6 | bc)) | tee -a ${GITHUB_OUTPUT}