Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release please for release branch #10467

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
56 changes: 34 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,57 @@ 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
else
DIST_TAG=latest
fi
TAG=${{ env.DEPLOY_TAG }}
VERSION=${TAG#aztec-packages-v}
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 +354,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/*"
Copy link
Member

@spypsy spypsy Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm so what happens now in the first job (release-please)? does this create separate PRs for each release/* branch that we can then merge to create a new versioned release? and if so will they still just be called aztec-packages-v*?
Or does release-please ignore non-master branches?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should create a different PR for each "release/*" branch. And the flow for when we merge that PR is in the description.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to start reading your descriptions before the code 🤦

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fairness, I should probably have those descriptions in the code.


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 }}" }'
Loading