Skip to content

Commit 65f6c25

Browse files
authored
Use changesets for releases (#528)
1 parent e19623a commit 65f6c25

25 files changed

+694
-83
lines changed

.changeset/add-account-contract.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@openzeppelin/wizard': patch
3+
---
4+
5+
Add `account` contract types for ERC-4337. ([#486](https://github.com/OpenZeppelin/contracts-wizard/pull/486))
6+
- **Potentially breaking changes**:
7+
- Update pragma versions to 0.8.27. ([#486](https://github.com/OpenZeppelin/contracts-wizard/pull/486))

.changeset/config.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "OpenZeppelin/contracts-wizard"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "public",
13+
"baseBranch": "master",
14+
"updateInternalDependencies": "patch",
15+
"ignore": [
16+
"@openzeppelin/wizard-cairo-alpha",
17+
"ui"
18+
]
19+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openzeppelin/wizard': patch
3+
---
4+
5+
Remove redundant overrides in Governor. ([#522](https://github.com/OpenZeppelin/contracts-wizard/pull/522))

.github/actions/setup/action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Setup
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
7+
with:
8+
node-version: 20.x
9+
cache: yarn
10+
11+
- name: Install dependencies
12+
run: yarn --frozen-lockfile --prefer-offline
13+
shell: bash

.github/workflows/changeset.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Changeset
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- opened
9+
- synchronize
10+
- labeled
11+
- unlabeled
12+
13+
concurrency:
14+
group: changeset-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
check:
19+
runs-on: ubuntu-latest
20+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }}
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
23+
with:
24+
fetch-depth: 0 # Include history so Changesets finds merge-base
25+
- name: Set up environment
26+
uses: ./.github/actions/setup
27+
- name: Check changeset
28+
run: npx changeset status --since=origin/${{ github.base_ref }}

.github/workflows/compile-cairo-alpha-project.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
1919

2020
- name: Setup node
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
2222
with:
2323
node-version: 20.x
2424
cache: 'yarn'
@@ -34,7 +34,7 @@ jobs:
3434
echo "SCARB_VERSION=$SCARB_VERSION" >> "$GITHUB_ENV"
3535
3636
- name: Setup Scarb
37-
uses: software-mansion/setup-scarb@v1
37+
uses: software-mansion/setup-scarb@f6ad35129872f897bdea556c09e11af8fb3293c0 #v1.5.1
3838
with:
3939
scarb-version: ${{ env.SCARB_VERSION }}
4040

.github/workflows/compile-cairo-project.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
1919

2020
- name: Setup node
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
2222
with:
2323
node-version: 20.x
2424
cache: 'yarn'
@@ -34,7 +34,7 @@ jobs:
3434
echo "SCARB_VERSION=$SCARB_VERSION" >> "$GITHUB_ENV"
3535
3636
- name: Setup Scarb
37-
uses: software-mansion/setup-scarb@v1
37+
uses: software-mansion/setup-scarb@f6ad35129872f897bdea556c09e11af8fb3293c0 #v1.5.1
3838
with:
3939
scarb-version: ${{ env.SCARB_VERSION }}
4040

.github/workflows/publish.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Packages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency: version-or-publish-${{ github.ref }}
7+
8+
jobs:
9+
publish:
10+
name: Publish Packages
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
runs-on: ubuntu-latest
15+
environment: publish
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
18+
with:
19+
fetch-depth: 0 # To get all tags
20+
ref: ${{ github.ref }}
21+
- name: Set up environment
22+
uses: ./.github/actions/setup
23+
- name: Create Prepare Release PR or Publish
24+
id: changesets
25+
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc #v1.4.10
26+
with:
27+
title: Prepare Release
28+
commit: Prepare Release
29+
version: npm run version
30+
publish: npm run publish
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
- name: Check changesets status
35+
if: steps.changesets.outputs.hasChangesets == 'true'
36+
run: |
37+
echo "Changesets found. Merge Prepare Release PR before publishing."
38+
exit 1
39+
- name: Check publish status
40+
if: steps.changesets.outputs.published == 'false'
41+
run: |
42+
echo "Publish failed. Check the logs for more details."
43+
exit 1

.github/workflows/test.yml

+11-23
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ jobs:
99
format-lint:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
14-
with:
15-
node-version: 20.x
16-
cache: 'yarn'
17-
- name: Install dependencies
18-
run: yarn install --network-concurrency 1
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
13+
- name: Set up environment
14+
uses: ./.github/actions/setup
1915
- name: Check formatting
2016
run: yarn format:check
2117
- name: Run linter
@@ -24,17 +20,13 @@ jobs:
2420
deno-check:
2521
runs-on: ubuntu-latest
2622
steps:
27-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
2824
- name: Set up Deno 1.46.3 (matching Netlify edge function environment)
29-
uses: denoland/setup-deno@v2
25+
uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 #v2.0.2
3026
with:
3127
deno-version: '1.46.3'
32-
- uses: actions/setup-node@v4
33-
with:
34-
node-version: 20.x
35-
cache: 'yarn'
36-
- name: Install dependencies and build wizard packages
37-
run: yarn install --frozen-lockfile
28+
- name: Set up environment
29+
uses: ./.github/actions/setup
3830
- name: Deno check API
3931
run: yarn type:check:api
4032

@@ -49,16 +41,12 @@ jobs:
4941

5042
runs-on: ubuntu-latest
5143
steps:
52-
- uses: actions/checkout@v4
53-
- uses: actions/setup-node@v4
54-
with:
55-
node-version: 20.x
56-
cache: 'yarn'
44+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
45+
- name: Set up environment
46+
uses: ./.github/actions/setup
5747
- name: Install Foundry
5848
if: matrix.package == 'solidity'
59-
uses: foundry-rs/foundry-toolchain@v1
60-
- name: Install dependencies
61-
run: yarn install
49+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de #v1.4.0
6250
- name: Compile TypeScript
6351
run: yarn tsc
6452
working-directory: packages/core/${{matrix.package}}

.github/workflows/version.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Version Packages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
concurrency: version-or-publish-${{ github.ref }}
9+
10+
jobs:
11+
version:
12+
name: Prepare Release PR
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
19+
with:
20+
fetch-depth: 0 # To get all tags
21+
ref: ${{ github.ref }}
22+
- name: Set up environment
23+
uses: ./.github/actions/setup
24+
- name: Create Prepare Release PR
25+
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc #v1.4.10
26+
with:
27+
title: Prepare Release
28+
commit: Prepare Release
29+
version: npm run version
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@ Then from the `packages/ui` directory:
6868
## Creating Pull Requests (PRs)
6969

7070
As a contributor, we ask that you fork this repository, work on your own fork and then submit pull requests. The pull requests will be reviewed and eventually merged into the main repo. See ["Fork-a-Repo"](https://help.github.com/articles/fork-a-repo/) for how this works.
71+
72+
### Adding Changesets
73+
If your PR modifies code generation logic under `packages/core`, you will need to add changesets for the relevant packages to summarize the changes. The PR's `Changeset` GitHub check will give an error if this condition is not satisfied.
74+
- To add a changeset: from the root directory, run `yarn changeset`

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "root",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"prepare": "wsrun -m prepare",
67
"lint": "eslint",
@@ -10,7 +11,9 @@
1011
"dev:ui": "yarn --cwd ./packages/ui dev",
1112
"dev:api": "yarn --cwd ./packages/ui dev:api",
1213
"dev": "concurrently --kill-others-on-fail --names \"UI,API\" --prefix-colors \"magenta.bold,green.bold\" \"yarn dev:ui\" \"yarn dev:api\"",
13-
"run:core": "node ./scripts/run-command.mjs"
14+
"run:core": "node ./scripts/run-command.mjs",
15+
"version": "bash scripts/release/version.sh",
16+
"publish": "bash scripts/release/publish.sh"
1417
},
1518
"workspaces": {
1619
"packages": [
@@ -33,6 +36,8 @@
3336
"prettier-plugin-svelte": "^3.3.3",
3437
"typescript": "^5.7.3",
3538
"typescript-eslint": "^8.29.0",
36-
"wsrun": "^5.2.4"
39+
"wsrun": "^5.2.4",
40+
"@changesets/cli": "^2.29.2",
41+
"@changesets/changelog-github": "^0.5.1"
3742
}
3843
}

packages/core/cairo/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
"prepublish": "rimraf dist *.tsbuildinfo",
2020
"test": "ava",
2121
"test:update-snapshots": "ava --update-snapshots",
22-
"test:watch": "ava --watch",
23-
"version": "node ../../../scripts/bump-changelog.js"
22+
"test:watch": "ava --watch"
2423
},
2524
"devDependencies": {
2625
"@types/node": "^20.0.0",

packages/core/cairo_alpha/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"prepublish": "rimraf dist *.tsbuildinfo",
2121
"test": "ava",
2222
"test:update-snapshots": "ava --update-snapshots",
23-
"test:watch": "ava --watch",
24-
"version": "node ../../../scripts/bump-changelog.js"
23+
"test:watch": "ava --watch"
2524
},
2625
"devDependencies": {
2726
"@types/node": "^20.0.0",

packages/core/solidity/CHANGELOG.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# Changelog
22

3-
## Unreleased
4-
5-
- Add `account` contract types for ERC-4337. ([#486](https://github.com/OpenZeppelin/contracts-wizard/pull/486))
6-
- Remove redundant overrides in Governor. ([#522](https://github.com/OpenZeppelin/contracts-wizard/pull/522))
7-
8-
- **Potentially breaking changes**:
9-
- Update pragma versions to 0.8.27. ([#486](https://github.com/OpenZeppelin/contracts-wizard/pull/486))
10-
113
## 0.5.4 (2025-04-01)
124

135
- Add validation for ERC20 premint field. ([#488](https://github.com/OpenZeppelin/contracts-wizard/pull/488))
@@ -16,7 +8,7 @@
168
## 0.5.3 (2025-03-13)
179

1810
- Add ERC20 Cross-Chain Bridging, SuperchainERC20. ([#436](https://github.com/OpenZeppelin/contracts-wizard/pull/436))
19-
**Note:** Cross-Chain Bridging is experimental and may be subject to change.
11+
**Note:** Cross-Chain Bridging is experimental and may be subject to change.
2012

2113
- **Potentially breaking changes**:
2214
- Change order of constructor argument `recipient` when using `premint`.
@@ -46,11 +38,12 @@
4638
## 0.4.5 (2024-11-18)
4739

4840
- Add `stablecoin` and `realWorldAsset` contract types. ([#404](https://github.com/OpenZeppelin/contracts-wizard/pull/404))
49-
**Note:** `stablecoin` and `realWorldAsset` are experimental and may be subject to change.
41+
**Note:** `stablecoin` and `realWorldAsset` are experimental and may be subject to change.
5042

5143
## 0.4.4 (2024-10-23)
5244

5345
### Potentially breaking changes
46+
5447
- Update pragma versions to 0.8.22. ([#401](https://github.com/OpenZeppelin/contracts-wizard/pull/401))
5548

5649
## 0.4.3 (2024-04-08)
@@ -68,6 +61,7 @@
6861
## 0.4.0 (2023-10-05)
6962

7063
### Breaking changes
64+
7165
- Update to OpenZeppelin Contracts 5.0. ([#284](https://github.com/OpenZeppelin/contracts-wizard/pull/284))
7266
- Require constructor or initializer arguments for initial owner or role assignments if using access control.
7367
- Use token-specific pausable extensions.

packages/core/solidity/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"test": "ava",
2020
"test:update-snapshots": "ava --update-snapshots",
2121
"test:watch": "ava --watch",
22-
"version": "node ../../../scripts/bump-changelog.js",
2322
"update-env": "rm ./src/environments/hardhat/package-lock.json && npm install --package-lock-only --prefix ./src/environments/hardhat && rm ./src/environments/hardhat/upgradeable/package-lock.json && npm install --package-lock-only --prefix ./src/environments/hardhat/upgradeable"
2423
},
2524
"devDependencies": {

packages/core/stellar/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"prepublish": "rimraf dist *.tsbuildinfo",
1919
"test": "ava",
2020
"test:update-snapshots": "ava --update-snapshots",
21-
"test:watch": "ava --watch",
22-
"version": "node ../../../scripts/bump-changelog.js"
21+
"test:watch": "ava --watch"
2322
},
2423
"devDependencies": {
2524
"@types/node": "^20.0.0",

packages/core/stylus/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"prepare": "tsc",
1818
"prepublish": "rimraf dist *.tsbuildinfo",
1919
"test": "ava",
20-
"test:watch": "ava --watch",
21-
"version": "node ../../../scripts/bump-changelog.js"
20+
"test:watch": "ava --watch"
2221
},
2322
"devDependencies": {
2423
"@types/node": "^20.0.0",

packages/ui/deno.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)