Skip to content

Commit 1f9bed0

Browse files
authored
Added release.sh for easy release automation and updated README.mds (#146)
* Added release.sh for easy release automation * Addressed comments * Addressed comments * Addressed comments * Addressed commits * Addressed commits * Addressed commits
1 parent e1bf38e commit 1f9bed0

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ curl -L https://raw.githubusercontent.com/paritytech/foundry-polkadot/refs/heads
1414

1515
This will install `foundryup-polkadot`. Simply follow the on-screen instructions, and the `foundryup-polkadot` command will become available in your CLI.
1616

17-
18-
Running `foundryup-polkadot --install v1.1.0-rc3` will automatically install the latest version of the [precompiled binaries](https://github.com/paritytech/foundry-polkadot/releases): forge, cast. For additional options, such as installing a specific version or commit, run `foundryup-polkadot --help`.
17+
Running `foundryup-polkadot` will automatically install the latest version of the [precompiled binaries](https://github.com/paritytech/foundry-polkadot/releases): forge, cast. For additional options, such as installing a specific version or commit, run `foundryup-polkadot --help`.
1918

2019
ℹ️ Note: if you're using Windows, you'll need to install and use [Git BASH](https://gitforwindows.org/) or [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) as your terminal, since Foundryup currently doesn't support Powershell or Command Prompt (CMD).
2120

release-test/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,27 @@ This folder contains scripts and resources for running comprehensive release tes
3535
You can specify the Foundry version using the `VERSION` build argument. If omitted, it defaults to `stable`.
3636

3737
```sh
38+
cd release-test
3839
docker build --build-arg VERSION=1.1.0-rc3 -t foundry .
3940
```
4041

4142
Or, to use the default `stable` version:
4243

4344
```sh
45+
cd release-test
4446
docker build -t foundry .
4547
```
4648

49+
Alternatively, you can get the latest changes from the `master` branch to use the latest version of the `foundry-polkadot` repository:
50+
51+
Comment out the `ENTRYPOINT` line in the `Dockerfile` to use the default entrypoint (and not `ENTRYPOINT ["/bin/sh", "-c"]`).
52+
53+
```sh
54+
docker build --platform=linux/amd64 -t foundry .
55+
```
56+
57+
Update `forge.sh` and `cast.sh` under `docker_run()` to use `docker run --platform=linux/amd64` instead of `docker run` to run the commands.
58+
4759
### 2. Run the Test Scripts
4860

4961
#### Logical Prerequisites for Test Scripts
@@ -105,6 +117,20 @@ docker build -t foundry .
105117
- **To change the RPC endpoint or test accounts:**
106118
Edit the `RPC_URL`, `ADDRESS`, or `PRIVATE_KEY` variables at the top of the scripts.
107119

120+
## How to Run Interactively
121+
122+
If you want to run a command interactively, you can use the following command to get a shell in the container:
123+
124+
```sh
125+
docker run --rm -it foundry sh
126+
```
127+
128+
For example, to run `forge --help` in the container while mounted the current `test/` directory:
129+
130+
```sh
131+
docker run --rm -v $PWD/test:/test -w /test foundry forge --help
132+
```
133+
108134
## Notes
109135

110136
- If a script fails, check the output log (`forge.txt` or `cast.txt`) for the last successful command and the error message.

release.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
set -e # exit on error.
4+
5+
### Check parameters for the new tag.
6+
7+
if [ -z "$1" ]; then
8+
echo "Error: No new TAG provided."
9+
echo "Example: $0 v1.1.0"
10+
exit 1
11+
fi
12+
13+
TAG="$1"
14+
15+
### Verify and prepare.
16+
17+
git checkout master
18+
git pull origin master
19+
20+
# git tag -d "$TAG" || true
21+
# git push --delete origin "$TAG" 2>/dev/null || true
22+
23+
# cargo build --release
24+
25+
### Update CHANGELOG.md.
26+
27+
LATEST_TAG=$(git tag --list 'v*' | sort -V | tail -n 1) # get the latest tag.
28+
git log --oneline --no-merges "$LATEST_TAG"..HEAD # get the latest changes.
29+
# TODO (@filip-parity): Update CHANGELOG.md with the latest changes.
30+
31+
### Update stable tag if needed.
32+
33+
# git push origin :refs/tags/stable # delete the remote stable tag.
34+
# git tag -fa stable -m "Update stable tag" # create or move the local stable tag (force, annotated).
35+
# git push origin --tags # push the new stable tag.
36+
37+
### Create and push version tag.
38+
39+
git tag -a "$TAG" -m "Created release tag $TAG" # create an annotated version tag.
40+
git push origin "$TAG" # push the version tag.

0 commit comments

Comments
 (0)