From 52715e67b081d865b3f7cffbdd72d87de5ca12c4 Mon Sep 17 00:00:00 2001 From: Sebastian Klingler Date: Fri, 19 Apr 2024 16:52:33 -0500 Subject: [PATCH] [INF-388] Improve protocol GH releases (#8159) --- .circleci/config.yml | 13 ++++++++++--- .circleci/src/jobs/@root-jobs.yml | 20 +++++++++++++++++--- .circleci/src/workflows/root.yml | 10 ++++++++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dcae46bcb2d..87e56bdbfa8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,8 +107,6 @@ jobs: - run: name: Create + push branch command: | - git checkout main - OLD_VERSION=$(jq -r .version packages/discovery-provider/.version.json) NEW_VERSION=$(echo ${OLD_VERSION} | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g') @@ -122,8 +120,17 @@ jobs: mv /tmp/.version.json packages/discovery-provider/.version.json git add packages/discovery-provider/.version.json + PROTOCOL_DIRS=$(bash ./scripts/get-release-dirs.sh protocol) + CHANGELOG=$(git log --pretty=format:"[%h] %s %an" --date=short protocol-v${OLD_VERSION}..HEAD -- ${PROTOCOL_DIRS}) + MESSAGE="Audius Protocol v${NEW_VERSION} + + ${CHANGELOG}" + git commit -m "${MESSAGE}" + + git tag protocol-v${NEW_VERSION} + git push origin protocol-v${NEW_VERSION} + # Weird way to push both to main and the new release branch - git commit -m "Bump version to $NEW_VERSION" git branch "release-v$NEW_VERSION" git checkout "release-v$NEW_VERSION" git push --set-upstream origin main "release-v$NEW_VERSION" diff --git a/.circleci/src/jobs/@root-jobs.yml b/.circleci/src/jobs/@root-jobs.yml index 2112123bb01..bfe579aae95 100644 --- a/.circleci/src/jobs/@root-jobs.yml +++ b/.circleci/src/jobs/@root-jobs.yml @@ -1,8 +1,7 @@ -# Publish github release for the current tag -root-publish-github-release: +root-publish-github-release-client: working_directory: ~/audius-protocol docker: - - image: cibuilds/github:0.10 + - image: cibuilds/github:0.13 steps: - checkout - attach_workspace: @@ -13,3 +12,18 @@ root-publish-github-release: VERSION=$(jq -r .version ./package.json) CHANGELOG=$(git log --format=%B -n 1) ghr -t ${GHI_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -b "${CHANGELOG}" -soft client-v${VERSION} ./ + +root-publish-github-release-protocol: + working_directory: ~/audius-protocol + docker: + - image: cibuilds/github:0.13 + steps: + - checkout + - attach_workspace: + at: ./ + - run: + name: 'Publish Release on GitHub' + command: | + VERSION=$(jq -r .version ./packages/discovery-provider/.version.json) + CHANGELOG=$(git log --format=%B -n 1) + ghr -t ${GHI_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -b "${CHANGELOG}" -soft protocol-v${VERSION} ./ diff --git a/.circleci/src/workflows/root.yml b/.circleci/src/workflows/root.yml index c8e8fa821ce..924d5f87cda 100644 --- a/.circleci/src/workflows/root.yml +++ b/.circleci/src/workflows/root.yml @@ -1,6 +1,12 @@ jobs: - - root-publish-github-release: + - root-publish-github-release-client: context: Audius Client filters: branches: - only: /(^release-client.*)$/ + only: /(^release-client-v.*)$/ + - root-publish-github-release-protocol: + # Audius Client context contains the GHI token + context: Audius Client + filters: + branches: + only: /(^release-v.*)$/