Skip to content

Commit

Permalink
feat: release please for release branch (#10467)
Browse files Browse the repository at this point in the history
Allows us to have release please PRs for our `release/*` branches. 

When we merge one of the release please PRs on a `release/*` branch
(e.g. `release/sassy-salamander`), the following happens:

- We create new images in dockerhub at e.g.
`aztecprotocol/aztec:sassy-salamander`
- We bump the `devnet` images in dockerhub at e.g.
`aztecprotocol/aztec:devnet`
- We create a regular (semantic versioned) npm release but tagged
`devnet` (as opposed to `latest`)
- We publish aztec-up to version `sassy-salamander`

All other existing publishing flows are unchanged.

Note: this implies that *before* merging the release PR, we have
deployed a new devnet, and the public `sassy-salamander` network.

Note: The
[issue](#10160)
states that if there are no changes between the `sassy-salamander`
branch and `master`, it will simply move tags forward. This does *not*
accomplish that. If that is really desired we should create a separate
ticket.
  • Loading branch information
just-mitch authored Dec 6, 2024
1 parent 9ebaa65 commit 38941bf
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 25 deletions.
58 changes: 36 additions & 22 deletions .github/workflows/publish-aztec-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- release/testnet*
- "*/release-master*"
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -212,7 +211,11 @@ jobs:
- name: Publish aztec manifests
if: ${{ env.SHOULD_PUBLISH_DOCKER_IMAGES == 'true' }}
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ github.ref_name }}" == "release/*" ]; then
TAG="${{ github.ref_name }}"
VERSION="${TAG#release/}"
DIST_TAG=devnet
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
TAG=${{ env.DEPLOY_TAG }}
VERSION=${TAG#aztec-packages-v}
DIST_TAG=latest
Expand Down Expand Up @@ -276,52 +279,59 @@ jobs:
concurrency_key: publish-npm
dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}"

- name: Set tags and versions
id: version_step
run: |
if [ "${{ github.ref_name }}" == "release/*" ]; then
DIST_TAG=devnet
TAG=${{ env.DEPLOY_TAG }}
VERSION=${TAG#aztec-packages-v}-devnet
else
DIST_TAG=latest
TAG=${{ env.DEPLOY_TAG }}
VERSION=${TAG#aztec-packages-v}
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "DIST_TAG=$DIST_TAG" >> $GITHUB_OUTPUT
- name: Publish bb.js NPM package
run: |
DEPLOY_TAG=${{ env.DEPLOY_TAG }}
VERSION=${DEPLOY_TAG#aztec-packages-v}
earthly-ci \
--no-output \
--secret NPM_TOKEN=${{ env.NPM_TOKEN }} \
./barretenberg/ts+publish-npm \
--DIST_TAG=latest \
--VERSION=$VERSION \
--DIST_TAG=${{ steps.version_step.outputs.DIST_TAG }} \
--VERSION=${{ steps.version_step.outputs.VERSION }} \
--DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }}
- name: Publish yarn-project NPM packages
run: |
DEPLOY_TAG=${{ env.DEPLOY_TAG }}
VERSION=${DEPLOY_TAG#aztec-packages-v}
earthly-ci \
--no-output \
--secret NPM_TOKEN=${{ env.NPM_TOKEN }} \
./yarn-project+publish-npm \
--DIST_TAG=latest \
--VERSION=$VERSION \
--DIST_TAG=${{ steps.version_step.outputs.DIST_TAG }} \
--VERSION=${{ steps.version_step.outputs.VERSION }} \
--DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }}
- name: Publish l1-contracts NPM package
run: |
DEPLOY_TAG=${{ env.DEPLOY_TAG }}
VERSION=${DEPLOY_TAG#aztec-packages-v}
earthly-ci \
--no-output \
--secret NPM_TOKEN=${{ env.NPM_TOKEN }} \
./l1-contracts+publish-npm \
--DIST_TAG=latest \
--VERSION=$VERSION \
--DIST_TAG=${{ steps.version_step.outputs.DIST_TAG }} \
--VERSION=${{ steps.version_step.outputs.VERSION }} \
--DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }}
- name: Publish spartan NPM package
run: |
DEPLOY_TAG=${{ env.DEPLOY_TAG }}
VERSION=${DEPLOY_TAG#aztec-packages-v}
earthly-ci \
--no-output \
--secret NPM_TOKEN=${{ env.NPM_TOKEN }} \
./spartan/releases/rough-rhino+publish-npm \
--DIST_TAG=latest \
--VERSION=$VERSION \
--DIST_TAG=${{ steps.version_step.outputs.DIST_TAG }} \
--VERSION=${{ steps.version_step.outputs.VERSION }} \
--DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }}
publish-aztec-up:
Expand All @@ -346,13 +356,17 @@ jobs:
- name: Publish aztec-up
working-directory: ./aztec-up/terraform
run: |
terraform init
if [ -n "${{ env.DEPLOY_TAG }}" ]; then
if [ "${{ github.ref_name }}" == "release/*" ]; then
TAG="${{ github.ref_name }}"
VERSION="${TAG#release/}"
elif [ -n "${{ env.DEPLOY_TAG }}" ]; then
TAG=${{ env.DEPLOY_TAG }}
VERSION=${TAG#aztec-packages-v}
else
TAG=${{ github.ref_name }}
VERSION=${{ github.ref_name }}
fi
export TF_VAR_VERSION=${TAG#aztec-packages-v}
terraform init
export TF_VAR_VERSION=${VERSION}
terraform apply -auto-approve
# Sometimes runners get killed because they can be spot, we try once more for good measure
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ on:
push:
branches:
- master
- "release/*"

permissions:
contents: write
pull-requests: write
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
release-please:
Expand All @@ -27,7 +30,7 @@ jobs:
if: ${{ steps.release.outputs.tag_name }}
with:
workflow: publish-aztec-packages.yml
ref: master
ref: ${{ env.BRANCH_NAME }}
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
inputs: '{ "tag": "${{ steps.release.outputs.tag_name }}", "publish": true }'

Expand All @@ -36,7 +39,7 @@ jobs:
if: ${{ steps.release.outputs.tag_name }}
with:
workflow: publish-bb.yml
ref: master
ref: ${{ env.BRANCH_NAME }}
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
inputs: '{ "tag": "${{ steps.release.outputs.tag_name }}", "publish": true }'

Expand All @@ -45,6 +48,6 @@ jobs:
if: ${{ steps.release.outputs.tag_name }}
with:
workflow: publish-docs.yml
ref: master
ref: ${{ env.BRANCH_NAME }}
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
inputs: '{ "tag": "${{ steps.release.outputs.tag_name }}" }'

0 comments on commit 38941bf

Please sign in to comment.