Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
26 changes: 3 additions & 23 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v7

- name: Extract current versions
- name: Extract current version
run: |
CURRENT_VERSION=$(grep '^version = ' Scarb.toml | sed 's/version = "\(.*\)"/\1/')
SCARB_VERSION=$(grep 'scarb-version = ' Scarb.toml | sed 's/scarb-version = "\(.*\)"/\1/')
CAIRO_VERSION=$(grep 'cairo-version = ' Scarb.toml | sed 's/cairo-version = "\(.*\)"/\1/')
{
echo "CURRENT_VERSION=$CURRENT_VERSION"
echo "SCARB_VERSION=$SCARB_VERSION"
echo "CAIRO_VERSION=$CAIRO_VERSION"
} >> "$GITHUB_ENV"
echo "CURRENT_VERSION=$CURRENT_VERSION" >> "$GITHUB_ENV"

- name: Extract new version number
run: echo "NEW_VERSION=${GITHUB_REF#refs/heads/release-v}" >> "$GITHUB_ENV"
Expand All @@ -38,21 +32,7 @@ jobs:
-not -path './audits/*' \
-exec sed -i "s/$ESCAPED_CURRENT_VERSION/$NEW_VERSION/g" {} +

- name: Setup scarb
uses: software-mansion/setup-scarb@v1
id: setup_scarb
with:
scarb-version: ${{ env.SCARB_VERSION }}

- name: Setup class_hash
uses: ericnordelo/setup-class-hash@c14dd33506c3eb8e1acfe2ade9f82585f5acf28c
with:
version: "0.2.0"

- name: Build presets artifacts
run: scarb --release build -p openzeppelin_presets

- name: Auto-commit changes
uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d #v7.2.0
with:
commit_message: Bump version to ${{ env.NEW_VERSION }} and update presets page
commit_message: Bump version to ${{ env.NEW_VERSION }}
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# Jupyter Notebook
.ipynb_checkpoints

Expand Down Expand Up @@ -144,8 +141,5 @@ dmypy.json
# node
**/node_modules/

# docs
docs/build/

# vscode
.vscode/
26 changes: 8 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ As a contributor, you are expected to fork this repository, work on your own for
git checkout -b fix/some-bug-short-description-#123
```

3. Make your changes, add your files, and [update the documentation](#documentation). Make sure to update the [CHANGELOG](CHANGELOG.md) (*[learn how](https://keepachangelog.com/en/1.1.0/)*).
3. Make your changes, add your files, and [update the corresponding documentation](#documentation). Make sure to update the [CHANGELOG](CHANGELOG.md) (*[learn how](https://keepachangelog.com/en/1.1.0/)*).

4. Commit and push to your fork.

Expand Down Expand Up @@ -68,27 +68,17 @@ As a contributor, you are expected to fork this repository, work on your own for

## Documentation

Before submitting the PR, you must update the corresponding documentation entries in the docs folder. In the future we may use something similar to solidity-docgen to automatically generate docs, but for now we are updating .adoc entries manually.
Documentation for Contracts for Cairo is maintained in the [OpenZeppelin Documentation repository](https://github.com/OpenZeppelin/docs/tree/main/content/contracts-cairo). When a contribution changes documented behavior, update the corresponding documentation in that repository.

NOTE: When the scarb version is bumped, the *Overview* page *Installation* section must be updated accordingly.
### Preset class hashes

If you want to run the documentation UI locally:
To generate the JavaScript constants used by the preset documentation, make sure `scarb` and `starkli` are installed and configured, then run:

1. Change directory into docs inside the project and run npm install.
```bash
python3 scripts/generate_class_hashes.py
```

```bash
cd docs && npm i
```

2. Build the docs and run the local server (default to localhost:8080). This will watch for changes in the docs/module folder, and update the UI accordingly.

```bash
npm run docs:watch
```

## Class hashes

Every time there's a language bump or a change in a preset or component used by one, new class hashes should be checked and updated in the presets doc page.
The script builds the `openzeppelin_presets` release artifacts and prints the `CLASS_HASH_SCARB_VERSION` and `CLASS_HASHES` constants for every current preset. Copy them into the corresponding `content/contracts-cairo/<version>/utils/constants.js` file in the documentation repository and update the preset table when its entries change. Pass `--no-build` to reuse existing release artifacts.

## Integration tests

Expand Down
8 changes: 0 additions & 8 deletions docs/antora.yml

This file was deleted.

Loading
Loading