From e54c35acd40d0b61cc2d8c28e50d1722552660f1 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 12:04:56 -0700 Subject: [PATCH 1/9] remove test_all from release script --- Scripts/run_prep.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index 322a55ae..6e675d9e 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -11,7 +11,7 @@ COLOR_RESET='\033[0m' COLOR_MAGENTA='\033[0;35m' COLOR_CYAN='\033[0;36m' MYREPO=${HOME}/workdir/${REPO_SLUG} -AUTOBRANCH=${GITHUB_USER}/prepareRelease${VERSION} +AUTOBRANCH=${GITHUB_USER}/prepareRelease-11${VERSION} BUILD_OUTPUT=/tmp/build.out touch $BUILD_OUTPUT @@ -41,13 +41,21 @@ function do_stuff { # we need pod install or test_all.sh fails - # cocoapods requires ENV['HOME'] with absolute path - HOME=$(pwd) - gem install cocoapods -v $COCOAPODS_VERSION - pod _${COCOAPODS_VERSION}_ repo update - pod _${COCOAPODS_VERSION}_ install + # we skip "test_all.sh" until we have a good reason to repeat it heere + # 1. this test takes long and also flaky tests can interrupt release process + # 2. this "test_all.sh" is supposed to pass before starting pre-release + # 3. prep auto PRs will be tested in CI/CD before starting release process. + + # - cocoapods requires ENV['HOME'] with absolute path + # + # HOME=$(pwd) + # gem install cocoapods -v $COCOAPODS_VERSION + # pod _${COCOAPODS_VERSION}_ repo update + # pod _${COCOAPODS_VERSION}_ install + # + # myscripts=( "update_version.sh ${VERSION}" "build_all.sh" "test_all.sh" ) + myscripts=( "update_version.sh ${VERSION}" "build_all.sh" ) - myscripts=( "update_version.sh ${VERSION}" "build_all.sh" "test_all.sh" ) for i in "${myscripts[@]}"; do echo -n "${i} " echo "===== ${i} =====" >> $BUILD_OUTPUT From 505ba499308e499ae39f92a1e4d7b6538c174528 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 12:11:15 -0700 Subject: [PATCH 2/9] add branch to pull-request --- Scripts/run_prep.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index 6e675d9e..b399ce77 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -11,7 +11,7 @@ COLOR_RESET='\033[0m' COLOR_MAGENTA='\033[0;35m' COLOR_CYAN='\033[0;36m' MYREPO=${HOME}/workdir/${REPO_SLUG} -AUTOBRANCH=${GITHUB_USER}/prepareRelease-11${VERSION} +AUTOBRANCH=${GITHUB_USER}/prepareRelease${VERSION} BUILD_OUTPUT=/tmp/build.out touch $BUILD_OUTPUT @@ -86,7 +86,7 @@ function push_changes { esac } git push -f https://${GITHUB_TOKEN}@github.com/${REPO_SLUG} ${AUTOBRANCH} - PR_URL=$(hub pull-request --no-edit -b ${BRANCH}) + PR_URL=$(hub pull-request --no-edit -b ${BRANCH} -h ${AUTOBRANCH}) echo -e "${COLOR_CYAN}ATTENTION:${COLOR_RESET} review and merge ${COLOR_CYAN}${PR_URL}${COLOR_RESET}" echo "then to release to cocoapods use Git action's Trigger build with the following payload:" echo -e "${COLOR_MAGENTA}env:${COLOR_RESET}" From f2a0c501f6a3eb37f28a02208d210b44ed885496 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 12:53:26 -0700 Subject: [PATCH 3/9] clean up --- .github/workflows/swift.yml | 3 ++- Scripts/run_prep.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index c89c7370..5a714ce2 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -46,7 +46,8 @@ jobs: curl -sSL https://download.sourceclear.com/ci.sh | bash unittests: - if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}" + # can skip for release but run for pre-release (validate upgraded version, etc.) + if: "${{ github.event.inputs.RELEASE == '' }}" uses: optimizely/swift-sdk/.github/workflows/unit_tests.yml@master prepare_for_release: diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index b399ce77..7350d9d9 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -86,7 +86,8 @@ function push_changes { esac } git push -f https://${GITHUB_TOKEN}@github.com/${REPO_SLUG} ${AUTOBRANCH} - PR_URL=$(hub pull-request --no-edit -b ${BRANCH} -h ${AUTOBRANCH}) + MESSAGE='[FSSDK-N/A]' # a dummy ref for required FSSDK checking + PR_URL=$(hub pull-request --no-edit -b ${BRANCH} -h ${AUTOBRANCH} -F ${MESSAGE}) echo -e "${COLOR_CYAN}ATTENTION:${COLOR_RESET} review and merge ${COLOR_CYAN}${PR_URL}${COLOR_RESET}" echo "then to release to cocoapods use Git action's Trigger build with the following payload:" echo -e "${COLOR_MAGENTA}env:${COLOR_RESET}" From 6591c389394a99108f855e9e80990a7da936e783 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 12:56:07 -0700 Subject: [PATCH 4/9] clean up --- .github/workflows/swift.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 5a714ce2..c89c7370 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -46,8 +46,7 @@ jobs: curl -sSL https://download.sourceclear.com/ci.sh | bash unittests: - # can skip for release but run for pre-release (validate upgraded version, etc.) - if: "${{ github.event.inputs.RELEASE == '' }}" + if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}" uses: optimizely/swift-sdk/.github/workflows/unit_tests.yml@master prepare_for_release: From a5aaa55f9a8f4d2118e1b602ed96ce28ebbc2ef0 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 13:10:09 -0700 Subject: [PATCH 5/9] fix error --- Scripts/run_prep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index 7350d9d9..4d4dbe4f 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -87,7 +87,7 @@ function push_changes { } git push -f https://${GITHUB_TOKEN}@github.com/${REPO_SLUG} ${AUTOBRANCH} MESSAGE='[FSSDK-N/A]' # a dummy ref for required FSSDK checking - PR_URL=$(hub pull-request --no-edit -b ${BRANCH} -h ${AUTOBRANCH} -F ${MESSAGE}) + PR_URL=$(hub pull-request --no-edit -b ${BRANCH} -h ${AUTOBRANCH} -m "${MESSAGE}") echo -e "${COLOR_CYAN}ATTENTION:${COLOR_RESET} review and merge ${COLOR_CYAN}${PR_URL}${COLOR_RESET}" echo "then to release to cocoapods use Git action's Trigger build with the following payload:" echo -e "${COLOR_MAGENTA}env:${COLOR_RESET}" From abcbb9864e9a62f20e763e36806bf4d13827f692 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 13:34:59 -0700 Subject: [PATCH 6/9] fix hub command --- Scripts/run_prep.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index 4d4dbe4f..bfcb842d 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -71,8 +71,17 @@ function push_changes { git config user.email "optibot@users.noreply.github.com" git config user.name "${GITHUB_USER}" git add --all - # this is like a try/catch - git commit -m "ci(git-action): auto release prep for $VERSION" || + + TITLE="ci(git-action): auto release prep for $VERSION" + # a dummy ref (FSSDK-N/A) for required FSSDK checking + MESSAGE=$(cat <<-END + ${TITLE}\n + \n + - [FSSDK-N/A] + END + ) + + git commit -m ${TITLE} || { case $? in 1 ) @@ -86,8 +95,8 @@ function push_changes { esac } git push -f https://${GITHUB_TOKEN}@github.com/${REPO_SLUG} ${AUTOBRANCH} - MESSAGE='[FSSDK-N/A]' # a dummy ref for required FSSDK checking - PR_URL=$(hub pull-request --no-edit -b ${BRANCH} -h ${AUTOBRANCH} -m "${MESSAGE}") + + PR_URL=$(hub pull-request -b ${BRANCH} -h ${AUTOBRANCH} -m "${MESSAGE}") echo -e "${COLOR_CYAN}ATTENTION:${COLOR_RESET} review and merge ${COLOR_CYAN}${PR_URL}${COLOR_RESET}" echo "then to release to cocoapods use Git action's Trigger build with the following payload:" echo -e "${COLOR_MAGENTA}env:${COLOR_RESET}" From b19c32ac2b258bec84235acb1b88bd5dcd8bfbca Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 14:08:05 -0700 Subject: [PATCH 7/9] clean up --- Scripts/run_prep.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index bfcb842d..f203cfd3 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -71,15 +71,16 @@ function push_changes { git config user.email "optibot@users.noreply.github.com" git config user.name "${GITHUB_USER}" git add --all - + TITLE="ci(git-action): auto release prep for $VERSION" - # a dummy ref (FSSDK-N/A) for required FSSDK checking - MESSAGE=$(cat <<-END - ${TITLE}\n - \n - - [FSSDK-N/A] - END - ) + # an empty line required between title and description + # a dummy ref (FSSDK-N/A) for required FSSDK checking + MESSAGE=$(cat < Date: Fri, 28 Apr 2023 14:17:40 -0700 Subject: [PATCH 8/9] clean up --- Scripts/run_prep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index f203cfd3..952ae98b 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -82,7 +82,7 @@ ${TITLE} END ) - git commit -m ${TITLE} || + git commit -m "${TITLE}" || { case $? in 1 ) From f0a8fd2a5770c473b5bd3c28e81752daa7847f45 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Fri, 28 Apr 2023 14:25:27 -0700 Subject: [PATCH 9/9] clean up --- Scripts/run_prep.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/run_prep.sh b/Scripts/run_prep.sh index 952ae98b..cf985c17 100755 --- a/Scripts/run_prep.sh +++ b/Scripts/run_prep.sh @@ -74,11 +74,11 @@ function push_changes { TITLE="ci(git-action): auto release prep for $VERSION" # an empty line required between title and description - # a dummy ref (FSSDK-N/A) for required FSSDK checking + # a dummy ref (FSSDK-1234) for required FSSDK checking MESSAGE=$(cat <