Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
critesjosh committed Jan 16, 2025
1 parent 69a421d commit 5ae7764
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
27 changes: 27 additions & 0 deletions .github/scripts/update-readme-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { readFileSync, writeFileSync } from 'fs';
import { dirname } from 'path';
import { fileURLToPath } from 'url';

// Read Nargo.toml
const nargoContent = readFileSync('Nargo.toml', 'utf8');
const versionMatch = nargoContent.match(/tag\s*=\s*"aztec-packages-v([^"]+)"/);
const version = versionMatch ? versionMatch[1] : null;

if (!version) {
console.error('Could not find version tag in Nargo.toml');
process.exit(1);
}

// Read README.md
const readmePath = 'README.md';
let readmeContent = readFileSync(readmePath, 'utf8');

// Update the aztec-up version
const updatedContent = readmeContent.replace(
/aztec-up \d+\.\d+\.\d+/,
`aztec-up ${version}`
);

// Write back to README
writeFileSync(readmePath, updatedContent);
console.log(`Updated README.md with version ${version}`);
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ Get the sandbox, aztec-cli and other tooling with this command:
bash -i <(curl -s https://install.aztec.network)
```

Modify the toolkit version to match the version (`x.x.x`) specified in Nargo.toml with:

```
aztec-up x.x.x
```

or update to the latest version with:
Install the correct version of the toolkit with:

```bash
aztec-up
aztec-up 0.69.1
```

Start the sandbox with:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"test": "yarn test:js && yarn test:nr",
"test:js": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json",
"test:nr": "aztec test",
"update": "aztec update --contract . && ./.github/scripts/update_contract.sh $(grep -oP 'tag\\s*=\\s*\"\\K[^\"]+' \"Nargo.toml\" | head -1) && yarn"
"update": "aztec update --contract . && ./.github/scripts/update_contract.sh $(grep -oP 'tag\\s*=\\s*\"\\K[^\"]+' \"Nargo.toml\" | head -1) && yarn && update-readme-version",
"update-readme-version": "node ./.github/scripts/update-readme-version.js"
},
"dependencies": {
"@aztec/accounts": "0.69.1",
Expand Down

0 comments on commit 5ae7764

Please sign in to comment.