Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ parameters:
full_ci:
type: boolean
default: false
sdk_version:
type: string
default: "patch"
sdk_preid:
type: string
default: ""

jobs:
noop:
Expand Down Expand Up @@ -353,6 +359,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
Expand Down Expand Up @@ -388,7 +402,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 >>
Expand Down Expand Up @@ -1781,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
Expand Down
11 changes: 10 additions & 1 deletion libs/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ 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

PREID=${3}

if [[ $(whoami) != "circleci" ]]; then
echo "This script is intended to be run through CI."
echo "Please see:"
Expand Down Expand Up @@ -66,7 +75,7 @@ function git-reset () {
function bump-version () {
(
# Patch the version
VERSION=$(npm version patch)
VERSION=$(npm version ${RELEASE_VERSION} --preid=${PREID})
Comment thread
rickyrombo marked this conversation as resolved.
tmp=$(mktemp)
jq ". += {audius: {releaseSHA: \"${GIT_COMMIT}\"}}" package.json > "$tmp" \
&& mv "$tmp" package.json
Expand Down