Skip to content

Commit

Permalink
[INF-388] Improve protocol GH releases (#8159)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Apr 19, 2024
1 parent e74455d commit 52715e6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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"
Expand Down
20 changes: 17 additions & 3 deletions .circleci/src/jobs/@root-jobs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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} ./
10 changes: 8 additions & 2 deletions .circleci/src/workflows/root.yml
Original file line number Diff line number Diff line change
@@ -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.*)$/

0 comments on commit 52715e6

Please sign in to comment.