From 7a14645435124b9a65e73e9a93b0b48be0c6bcfc Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:36:01 -0800 Subject: [PATCH 1/9] Fix script to allow version paramter, temporarily disable publish --- libs/scripts/release.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/scripts/release.sh b/libs/scripts/release.sh index 14c1d63e77a..9dac79a1b16 100755 --- a/libs/scripts/release.sh +++ b/libs/scripts/release.sh @@ -7,6 +7,13 @@ else GIT_COMMIT=${1} fi +if [[ -z ${2} ]]; then + echo "A version must be supplied as the second parameter (See `npm version` for valid values)." + exit 2 +else + RELEASE_VERSION=${2} +fi + if [[ $(whoami) != "circleci" ]]; then echo "This script is intended to be run through CI." echo "Please see:" @@ -66,7 +73,7 @@ function git-reset () { function bump-version () { ( # Patch the version - VERSION=$(npm version patch) + VERSION=$(npm version ${RELEASE_VERSION}) tmp=$(mktemp) jq ". += {audius: {releaseSHA: \"${GIT_COMMIT}\"}}" package.json > "$tmp" \ && mv "$tmp" package.json @@ -111,7 +118,8 @@ function merge-bump () { # publish to npm function publish () { - npm publish . --access public + echo "not actually publishing!" + # npm publish . --access public } # informative links From b66a3bff8c9a331e20515b2ec78f085ce43c665f Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:41:18 -0800 Subject: [PATCH 2/9] Change circle ci to publish sdk with a specified version --- .circleci/config.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e59b855715c..43ffa6b8c80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -353,6 +353,14 @@ jobs: description: The git commit to build and release type: string default: "" + version: + description: The version to publish + type: string + default: "" + preid: + description: See npm version preid + type: string + default: "" slack_mentions_user: description: Used for CircleCI @mentions type: string @@ -388,7 +396,7 @@ jobs: name: Bump and Publish Libs command: | export PROTOCOL_DIR=/home/circleci/project - libs/scripts/release.sh << parameters.sdk_release_commit >> + libs/scripts/release.sh << parameters.sdk_release_commit >> << parameters.version >> << parameters.preid >> - slack-fail: branch_pattern: main slack_mentions_user: << parameters.slack_mentions_user >> From f0148e5d58aaef065a69e4fc3874ec430125afb0 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:45:58 -0800 Subject: [PATCH 3/9] Update script to take preid if specified --- libs/scripts/release.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/scripts/release.sh b/libs/scripts/release.sh index 9dac79a1b16..d6dc4c5702c 100755 --- a/libs/scripts/release.sh +++ b/libs/scripts/release.sh @@ -14,6 +14,8 @@ else RELEASE_VERSION=${2} fi +PREID=${3} + if [[ $(whoami) != "circleci" ]]; then echo "This script is intended to be run through CI." echo "Please see:" @@ -73,7 +75,7 @@ function git-reset () { function bump-version () { ( # Patch the version - VERSION=$(npm version ${RELEASE_VERSION}) + VERSION=$(npm version ${RELEASE_VERSION} --preid=${PREID}) tmp=$(mktemp) jq ". += {audius: {releaseSHA: \"${GIT_COMMIT}\"}}" package.json > "$tmp" \ && mv "$tmp" package.json From ea9649cb4141d94f1f89862a3119d57958199ff2 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 19:27:13 -0800 Subject: [PATCH 4/9] Add params to sdk-release --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43ffa6b8c80..5f835a960ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -276,6 +276,12 @@ parameters: full_ci: type: boolean default: false + sdk_version: + type: string + default: "" + sdk_preid: + type: string + default: "" jobs: noop: @@ -1789,6 +1795,8 @@ workflows: name: publish-sdk (<< pipeline.parameters.sdk_release_commit >>) sdk_release_commit: << pipeline.parameters.sdk_release_commit >> slack_mentions_user: << pipeline.parameters.slack_mentions_user >> + preid: << pipeline.parameters.sdk_preid >> + version: << pipeline.parameters.sdk_version >> context: - Audius Client - slack-secrets From 5778b58255d4a4b157802c930977ed8f11208b16 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 19:32:49 -0800 Subject: [PATCH 5/9] Temp disable main/release branch check --- libs/scripts/release.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/scripts/release.sh b/libs/scripts/release.sh index d6dc4c5702c..a19bbe92f1b 100755 --- a/libs/scripts/release.sh +++ b/libs/scripts/release.sh @@ -59,11 +59,11 @@ function git-reset () { fi # only allow commits found on main or release branches to be deployed - echo "commit has to be on main or a release branch" - git branch -a --contains ${GIT_COMMIT} \ - | tee /dev/tty \ - | grep -Eq 'remotes/origin/main|remotes/origin/release' \ - || exit 1 + # echo "commit has to be on main or a release branch" + # git branch -a --contains ${GIT_COMMIT} \ + # | tee /dev/tty \ + # | grep -Eq 'remotes/origin/main|remotes/origin/release' \ + # || exit 1 # Ensure working directory clean git reset --hard ${GIT_COMMIT} From df616617ecbedd0fdd9b22cf8584df914973a6f4 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 19:38:24 -0800 Subject: [PATCH 6/9] undo testing changes --- libs/scripts/release.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/scripts/release.sh b/libs/scripts/release.sh index a19bbe92f1b..cb9541f675c 100755 --- a/libs/scripts/release.sh +++ b/libs/scripts/release.sh @@ -59,11 +59,11 @@ function git-reset () { fi # only allow commits found on main or release branches to be deployed - # echo "commit has to be on main or a release branch" - # git branch -a --contains ${GIT_COMMIT} \ - # | tee /dev/tty \ - # | grep -Eq 'remotes/origin/main|remotes/origin/release' \ - # || exit 1 + echo "commit has to be on main or a release branch" + git branch -a --contains ${GIT_COMMIT} \ + | tee /dev/tty \ + | grep -Eq 'remotes/origin/main|remotes/origin/release' \ + || exit 1 # Ensure working directory clean git reset --hard ${GIT_COMMIT} @@ -120,8 +120,7 @@ function merge-bump () { # publish to npm function publish () { - echo "not actually publishing!" - # npm publish . --access public + npm publish . --access public } # informative links From b334c1ff4533fa2d756022b29e20fbb9d328bf8c Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:22:08 -0800 Subject: [PATCH 7/9] Revert "undo testing changes" This reverts commit df616617ecbedd0fdd9b22cf8584df914973a6f4. --- libs/scripts/release.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/scripts/release.sh b/libs/scripts/release.sh index cb9541f675c..a19bbe92f1b 100755 --- a/libs/scripts/release.sh +++ b/libs/scripts/release.sh @@ -59,11 +59,11 @@ function git-reset () { fi # only allow commits found on main or release branches to be deployed - echo "commit has to be on main or a release branch" - git branch -a --contains ${GIT_COMMIT} \ - | tee /dev/tty \ - | grep -Eq 'remotes/origin/main|remotes/origin/release' \ - || exit 1 + # echo "commit has to be on main or a release branch" + # git branch -a --contains ${GIT_COMMIT} \ + # | tee /dev/tty \ + # | grep -Eq 'remotes/origin/main|remotes/origin/release' \ + # || exit 1 # Ensure working directory clean git reset --hard ${GIT_COMMIT} @@ -120,7 +120,8 @@ function merge-bump () { # publish to npm function publish () { - npm publish . --access public + echo "not actually publishing!" + # npm publish . --access public } # informative links From bea524e0d79321f11cd2c2b2629da6ce2cef718f Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:26:06 -0800 Subject: [PATCH 8/9] default to patch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f835a960ae..da48f2d5b65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -278,7 +278,7 @@ parameters: default: false sdk_version: type: string - default: "" + default: "patch" sdk_preid: type: string default: "" From 67e809854bf0451f81f2d16e2ff5821118a62d87 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:29:20 -0800 Subject: [PATCH 9/9] Reland "undo testing changes" This reverts commit b334c1ff4533fa2d756022b29e20fbb9d328bf8c. --- libs/scripts/release.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/scripts/release.sh b/libs/scripts/release.sh index a19bbe92f1b..cb9541f675c 100755 --- a/libs/scripts/release.sh +++ b/libs/scripts/release.sh @@ -59,11 +59,11 @@ function git-reset () { fi # only allow commits found on main or release branches to be deployed - # echo "commit has to be on main or a release branch" - # git branch -a --contains ${GIT_COMMIT} \ - # | tee /dev/tty \ - # | grep -Eq 'remotes/origin/main|remotes/origin/release' \ - # || exit 1 + echo "commit has to be on main or a release branch" + git branch -a --contains ${GIT_COMMIT} \ + | tee /dev/tty \ + | grep -Eq 'remotes/origin/main|remotes/origin/release' \ + || exit 1 # Ensure working directory clean git reset --hard ${GIT_COMMIT} @@ -120,8 +120,7 @@ function merge-bump () { # publish to npm function publish () { - echo "not actually publishing!" - # npm publish . --access public + npm publish . --access public } # informative links