Update to Latest Nightly #52
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: Update to Latest Nightly | |
| on: | |
| schedule: | |
| # Run daily at 6 AM UTC (after nextnet deploys at 5 AM) | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Nightly version (e.g., 4.0.0-nightly.20260206)' | |
| required: false | |
| type: string | |
| deploy: | |
| description: 'Deploy to nextnet after update' | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-nightly: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/next' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: next | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Run update script | |
| env: | |
| PASSWORD: ${{ secrets.PASSWORD }} | |
| CI: 1 | |
| run: | | |
| ARGS="" | |
| if [ -n "${{ inputs.version }}" ]; then | |
| ARGS="$ARGS --version ${{ inputs.version }}" | |
| fi | |
| if [ "${{ inputs.deploy }}" == "true" ]; then | |
| ARGS="$ARGS --deploy" | |
| fi | |
| node scripts/update-to-nightly.js $ARGS | |
| - name: Update PATH | |
| run: | | |
| VERSION=$(node -e "const p = JSON.parse(require('fs').readFileSync('package.json','utf-8')); console.log(p.dependencies['@aztec/aztec.js'].replace(/^v/,''))") | |
| echo "$HOME/.aztec/versions/${VERSION}/bin" >> $GITHUB_PATH | |
| echo "$HOME/.aztec/versions/${VERSION}/node_modules/.bin" >> $GITHUB_PATH | |
| - name: Get updated version | |
| id: version | |
| run: | | |
| VERSION=$(node -e "const p = JSON.parse(require('fs').readFileSync('package.json','utf-8')); console.log(p.dependencies['@aztec/aztec.js'])") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| commit-message: "chore: update to ${{ steps.version.outputs.version }}" | |
| title: "chore: update to ${{ steps.version.outputs.version }}" | |
| body: | | |
| Automated update to Aztec nightly version ${{ steps.version.outputs.version }} | |
| **Changes:** | |
| - Updated all @aztec/* dependencies in package.json | |
| - Updated Nargo.toml files with new tag | |
| - Updated README.md references | |
| - Compiled contracts with new version | |
| **Note:** This PR was created automatically by the update-nightly workflow. | |
| branch: automated-nightly-update-${{ steps.version.outputs.version }} | |
| delete-branch: true | |
| base: next |