chore: merge v4-next (#22528) #5906
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release-please | |
| on: | |
| push: | |
| branches: | |
| - "v[0-9]*" | |
| - master | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| env: | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| jobs: | |
| release-please: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release-pr: ${{ steps.release.outputs.pr }} | |
| release-version: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - name: Run Release Please | |
| id: release | |
| uses: googleapis/release-please-action@7d28262f14160787a44a6be36146a18e6f575a3f | |
| with: | |
| token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| config-file: .github/release-please-${{ github.ref_name }}.json | |
| target-branch: ${{ github.ref_name }} | |
| dedupe-release-notes: | |
| name: Deduplicate release notes | |
| needs: [release-please] | |
| if: ${{ needs.release-please.outputs.release-pr }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Check if release notes branch exists | |
| id: check-branch | |
| env: | |
| GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| run: | | |
| NOTES_BRANCH="${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}--release-notes" | |
| if git ls-remote --exit-code "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "refs/heads/$NOTES_BRANCH" >/dev/null 2>&1; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| echo "branch=$NOTES_BRANCH" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| echo "Release notes branch $NOTES_BRANCH does not exist, skipping deduplication" | |
| fi | |
| - name: Checkout release notes branch | |
| if: steps.check-branch.outputs.exists == 'true' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| ref: ${{ steps.check-branch.outputs.branch }} | |
| fetch-depth: 1 | |
| token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| - name: Fetch dedupe script from target branch | |
| if: steps.check-branch.outputs.exists == 'true' | |
| run: | | |
| git fetch origin ${{ github.ref_name }} --depth=1 | |
| git show origin/${{ github.ref_name }}:scripts/dedupe_release_notes.py > /tmp/dedupe_release_notes.py | |
| - name: Configure Git | |
| if: steps.check-branch.outputs.exists == 'true' | |
| run: | | |
| git config --global user.name AztecBot | |
| git config --global user.email tech@aztecprotocol.com | |
| - name: Deduplicate release notes | |
| if: steps.check-branch.outputs.exists == 'true' | |
| run: | | |
| if [ -f release-notes.md ]; then | |
| python3 /tmp/dedupe_release_notes.py release-notes.md | |
| git add release-notes.md | |
| if ! git diff --cached --quiet; then | |
| git commit -m "chore: deduplicate release notes" | |
| git push | |
| fi | |
| fi | |
| - name: Update PR body with deduped notes | |
| if: steps.check-branch.outputs.exists == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| run: | | |
| if [ -f release-notes.md ]; then | |
| PR_NUMBER=${{ fromJSON(needs.release-please.outputs.release-pr).number }} | |
| NOTES_SIZE=$(wc -c < release-notes.md) | |
| if [ "$NOTES_SIZE" -lt 60000 ]; then | |
| gh pr edit "$PR_NUMBER" --body "$(cat release-notes.md)" | |
| fi | |
| fi | |
| update-docs: | |
| name: Update docs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| needs: [release-please] | |
| if: ${{ needs.release-please.outputs.release-pr }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout release branch | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }} | |
| token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| - name: Setup dependencies | |
| run: | | |
| sudo apt install -y --no-install-recommends doxygen | |
| corepack enable | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name AztecBot | |
| git config --global user.email tech@aztecprotocol.com | |
| - name: Install Noir toolchain | |
| uses: noir-lang/noirup@v0.1.4 | |
| with: | |
| toolchain: nightly | |
| - name: Query new version | |
| id: version | |
| run: | | |
| # Extract version from .release-please-manifest.json | |
| AZTEC_VERSION=$(jq -r '."."' .release-please-manifest.json) | |
| # Add v prefix | |
| AZTEC_VERSION="v$AZTEC_VERSION" | |
| echo "semver=$AZTEC_VERSION" >> $GITHUB_OUTPUT | |
| - name: Generate Aztec.nr API documentation | |
| working-directory: ./docs | |
| run: | | |
| ./scripts/aztec_nr_docs_generation/generate_aztec_nr_docs.sh ${{ steps.version.outputs.semver }} | |
| echo "Generated Aztec.nr API docs for: ${{ steps.version.outputs.semver }}" | |
| - name: Build bb (uses cache if available) | |
| working-directory: ./barretenberg/cpp | |
| run: | | |
| ./bootstrap.sh build_native | |
| echo "BB_PATH=$(pwd)/build/bin" >> $GITHUB_ENV | |
| - name: Build noir packages | |
| run: | | |
| # Initialize noir submodule (required for yarn-project portal dependencies) | |
| git submodule update --init --recursive noir/noir-repo | |
| # Build noir JS packages (creates noir/packages/ directory needed by yarn-project) | |
| cd noir | |
| ./bootstrap.sh install_deps | |
| ./bootstrap.sh build_packages | |
| - name: Build aztec CLI | |
| id: build-cli | |
| continue-on-error: true | |
| working-directory: ./yarn-project | |
| run: | | |
| ./bootstrap.sh | |
| echo "AZTEC_CLI_PATH=$(pwd)/aztec/dest/bin" >> $GITHUB_ENV | |
| - name: Generate TypeScript API documentation | |
| if: steps.build-cli.outcome == 'success' | |
| working-directory: ./docs | |
| run: | | |
| # Generate TypeScript API docs for this version (requires yarn-project to be built) | |
| ./scripts/typescript_api_generation/generate_ts_api_docs.sh ${{ steps.version.outputs.semver }} | |
| echo "Generated TypeScript API docs for: ${{ steps.version.outputs.semver }}" | |
| - name: Generate Aztec CLI documentation | |
| id: aztec-cli-docs | |
| if: steps.build-cli.outcome == 'success' | |
| working-directory: ./docs | |
| continue-on-error: true | |
| run: | | |
| # Add locally built binaries to PATH | |
| export PATH="${BB_PATH}:${PATH}" | |
| # Create wrapper for aztec CLI that runs the local build | |
| mkdir -p /tmp/cli-bin | |
| cat > /tmp/cli-bin/aztec << 'EOF' | |
| #!/bin/bash | |
| node "$AZTEC_CLI_PATH/index.js" "$@" | |
| EOF | |
| chmod +x /tmp/cli-bin/aztec | |
| # Copy aztec-up from repo (it's a standalone bash script) | |
| cp "$GITHUB_WORKSPACE/aztec-up/bin/aztec-up" /tmp/cli-bin/aztec-up | |
| chmod +x /tmp/cli-bin/aztec-up | |
| export PATH="/tmp/cli-bin:${PATH}" | |
| # Generate Aztec CLI docs using locally built binaries | |
| ./scripts/cli_reference_generation/generate_all_cli_docs.sh --force current | |
| echo "Generated Aztec CLI documentation for: ${{ steps.version.outputs.semver }}" | |
| - name: Generate BB CLI documentation | |
| id: bb-cli-docs | |
| working-directory: ./barretenberg/docs | |
| continue-on-error: true | |
| run: | | |
| # Add locally built bb to PATH | |
| export PATH="${BB_PATH}:${PATH}" | |
| # Generate BB CLI docs | |
| ./scripts/generate_bb_cli_docs.sh --force current | |
| echo "Generated BB CLI documentation for: ${{ steps.version.outputs.semver }}" | |
| - name: Comment on PR if CLI docs generation failed | |
| if: steps.build-cli.outcome == 'failure' || steps.aztec-cli-docs.outcome == 'failure' || steps.bb-cli-docs.outcome == 'failure' | |
| env: | |
| GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
| run: | | |
| FAILED_DOCS="" | |
| if [[ "${{ steps.build-cli.outcome }}" == "failure" ]]; then | |
| FAILED_DOCS="yarn-project build (cache miss)" | |
| fi | |
| if [[ "${{ steps.aztec-cli-docs.outcome }}" == "failure" ]]; then | |
| if [[ -n "$FAILED_DOCS" ]]; then | |
| FAILED_DOCS="$FAILED_DOCS, Aztec CLI" | |
| else | |
| FAILED_DOCS="Aztec CLI" | |
| fi | |
| fi | |
| if [[ "${{ steps.bb-cli-docs.outcome }}" == "failure" ]]; then | |
| if [[ -n "$FAILED_DOCS" ]]; then | |
| FAILED_DOCS="$FAILED_DOCS, BB CLI" | |
| else | |
| FAILED_DOCS="BB CLI" | |
| fi | |
| fi | |
| gh pr comment ${{ fromJSON(needs.release-please.outputs.release-pr).number }} --body "$(cat <<EOF | |
| ## CLI Documentation Generation Failed | |
| The following CLI documentation failed to generate: $FAILED_DOCS | |
| The release will continue, but CLI reference docs may be incomplete for this version. | |
| cc @AztecProtocol/devrel | |
| [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
| EOF | |
| )" | |
| - name: Cut Aztec Developer Docs version | |
| working-directory: ./docs | |
| run: | | |
| COMMIT_TAG=${{ steps.version.outputs.semver }} | |
| yarn | |
| COMMIT_TAG=$COMMIT_TAG yarn build | |
| # Create versioned docs for Developer docs instance | |
| COMMIT_TAG=$COMMIT_TAG yarn docusaurus docs:version:developer ${{ steps.version.outputs.semver }} | |
| - name: Update Aztec Developer Docs versions with new version | |
| working-directory: ./docs/scripts | |
| run: | | |
| ./update_docs_versions.sh developer | |
| - name: Cut Aztec Network Docs version | |
| working-directory: ./docs | |
| run: | | |
| COMMIT_TAG=${{ steps.version.outputs.semver }} | |
| # Create versioned docs for Network docs instance | |
| COMMIT_TAG=$COMMIT_TAG yarn docusaurus docs:version:network ${{ steps.version.outputs.semver }} | |
| - name: Update Aztec Network Docs versions with new version | |
| working-directory: ./docs/scripts | |
| run: | | |
| ./update_docs_versions.sh network | |
| - name: Commit new Aztec Docs version | |
| run: | | |
| # Reset non-versioned CLI docs (only versioned copies should be committed) | |
| git checkout -- docs/docs-developers/docs/cli/*_cli_reference.md || true | |
| git add . | |
| git commit -m "chore(docs): cut new aztec docs version for tag ${{ steps.version.outputs.semver }}" | |
| git push | |
| - name: Cut Barretenberg Docs version | |
| working-directory: ./barretenberg/docs | |
| run: | | |
| COMMIT_TAG=${{ steps.version.outputs.semver }} | |
| # need to specify at least one version in versions.json for it to build | |
| echo "[ \"$(./scripts/get_current_version.sh)\" ]" > versions.json | |
| yarn | |
| COMMIT_TAG=$COMMIT_TAG yarn build | |
| COMMIT_TAG=$COMMIT_TAG yarn docusaurus docs:version ${{ steps.version.outputs.semver }} | |
| - name: Update Barretenberg Docs versions.json with new version | |
| working-directory: ./barretenberg/docs/scripts | |
| run: | | |
| ./update_versions.sh | |
| - name: Commit new Barretenberg Docs version | |
| run: | | |
| git add . | |
| git commit -m "chore(docs): cut new barretenberg docs version for tag ${{ steps.version.outputs.semver }}" | |
| git push |