Skip to content

Commit 55c4e32

Browse files
elle-jxermicus
andauthored
Show binary releases details on resolc-bin GH Pages site (#447)
## Description For more easily finding the details of the resolc binary releases for the various supported platforms, the plain JSON information will be displayed on [resolc-bin](https://github.com/paritytech/resolc-bin)'s [GitHub Pages website](https://paritytech.github.io/resolc-bin/). Changes: * Whenever there is a regular or nightly release: * The corresponding workflow files will run a script to update resolc-bin's `index.md` file (new file) with the updated JSON. * `index.md` will be the file GitHub Pages serves as HTML (by default it is built with Jekyll and the Markdown is processed by kramdown, hence the syntax seen in the script). * Documentation updates Thus, this will run on the next nightly release after this PR is merged. ## Resolved Issues Closes #443 --------- Co-authored-by: xermicus <cyrill@parity.io>
1 parent 81ce306 commit 55c4e32

File tree

11 files changed

+174
-14
lines changed

11 files changed

+174
-14
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
#!/bin/bash
2+
3+
# This script updates `index.md` in the GitHub Pages root directory provided
4+
# by the required argument to be passed. The file will be updated to simply
5+
# render the `resolc-bin` JSON data for each of the supported platforms.
6+
# `index.md` is the file served by GitHub Pages after being built by Jekyll
7+
# and the Markdown processed by kramdown.
8+
9+
set -exo pipefail
10+
11+
gh_pages_root_dir="$1"
12+
if [ -z "$gh_pages_root_dir" ]; then
13+
echo "Error: The path to the GitHub Pages root directory must be passed"
14+
exit 1
15+
fi
16+
17+
linux="$gh_pages_root_dir/linux/list.json"
18+
macos="$gh_pages_root_dir/macos/list.json"
19+
wasm="$gh_pages_root_dir/wasm/list.json"
20+
windows="$gh_pages_root_dir/windows/list.json"
21+
nightly_linux="$gh_pages_root_dir/nightly/linux/list.json"
22+
nightly_macos="$gh_pages_root_dir/nightly/macos/list.json"
23+
nightly_wasm="$gh_pages_root_dir/nightly/wasm/list.json"
24+
nightly_windows="$gh_pages_root_dir/nightly/windows/list.json"
25+
26+
build_info_files=("$linux" "$macos" "$wasm" "$windows" "$nightly_linux"
27+
"$nightly_macos" "$nightly_wasm" "$nightly_windows")
28+
29+
for file in "${build_info_files[@]}"; do
30+
if [ ! -f "$file" ]; then
31+
echo "Error: File does not exist - $file"
32+
exit 1
33+
fi
34+
done
35+
36+
# Sort the data by version in descending order.
37+
sort_by_version_descending() {
38+
local build_info_file="$1"
39+
if [ -z "$build_info_file" ]; then
40+
echo "Error: A file path argument is required for sorting"
41+
return 1
42+
fi
43+
44+
# Load the data and sort builds and releases with the latest version first.
45+
data=$(jq '.' "$build_info_file")
46+
sorted_data=$(echo "$data" | jq '.builds = (.builds | sort_by(.version) | reverse) |
47+
.releases = (.releases | to_entries | sort_by(.key) | reverse | from_entries)')
48+
49+
echo "$sorted_data" | jq .
50+
}
51+
52+
echo "Updating GitHub Pages index.md file..."
53+
54+
cat > "$gh_pages_root_dir/index.md" << EOF
55+
---
56+
title: resolc-bin
57+
---
58+
59+
# resolc-bin
60+
61+
Listed here are details about the \`resolc\` binary releases for the supported platforms.
62+
The information is synced with the [resolc-bin GitHub repository](https://github.com/paritytech/resolc-bin).
63+
64+
## Linux
65+
66+
<details>
67+
<summary>See builds</summary>
68+
69+
{% highlight json %}
70+
$(sort_by_version_descending $linux)
71+
{% endhighlight %}
72+
73+
</details>
74+
75+
## MacOS
76+
77+
<details>
78+
<summary>See builds</summary>
79+
80+
{% highlight json %}
81+
$(sort_by_version_descending $macos)
82+
{% endhighlight %}
83+
84+
</details>
85+
86+
## Wasm
87+
88+
<details>
89+
<summary>See builds</summary>
90+
91+
{% highlight json %}
92+
$(sort_by_version_descending $wasm)
93+
{% endhighlight %}
94+
95+
</details>
96+
97+
## Windows
98+
99+
<details>
100+
<summary>See builds</summary>
101+
102+
{% highlight json %}
103+
$(sort_by_version_descending $windows)
104+
{% endhighlight %}
105+
106+
</details>
107+
108+
## Nightly
109+
110+
### Linux
111+
112+
<details>
113+
<summary>See builds</summary>
114+
115+
{% highlight json %}
116+
$(sort_by_version_descending $nightly_linux)
117+
{% endhighlight %}
118+
119+
</details>
120+
121+
### MacOS
122+
123+
<details>
124+
<summary>See builds</summary>
125+
126+
{% highlight json %}
127+
$(sort_by_version_descending $nightly_macos)
128+
{% endhighlight %}
129+
130+
</details>
131+
132+
### Wasm
133+
134+
<details>
135+
<summary>See builds</summary>
136+
137+
{% highlight json %}
138+
$(sort_by_version_descending $nightly_wasm)
139+
{% endhighlight %}
140+
141+
</details>
142+
143+
### Windows
144+
145+
<details>
146+
<summary>See builds</summary>
147+
148+
{% highlight json %}
149+
$(sort_by_version_descending $nightly_windows)
150+
{% endhighlight %}
151+
152+
</details>
153+
EOF
154+
155+
echo "File has been updated!"

.github/workflows/book.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ jobs:
3737
- name: Compare with committed docs
3838
run: |
3939
if ! diff -r docs-tmp docs 2>/dev/null; then
40-
echo "docs/ is not up-to-date. Run make test-book and commit the docs/ directory"
40+
echo "docs/ is not up-to-date. Run \`make book\` and commit the docs/ directory"
4141
exit 1
4242
fi

.github/workflows/generate_versions.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
cd resolc-bin
4848
python ../tmp/.github/scripts/json_generator.py ${GITHUB_REPOSITORY} ${{ github.event.release.tag_name }}
4949
50+
# Update GitHub Pages file with the JSON data.
51+
chmod +x ../tmp/.github/scripts/resolc-bin-gh-pages.sh
52+
bash ../tmp/.github/scripts/resolc-bin-gh-pages.sh $PWD
53+
5054
echo "${Green}Add new remote with gh app token${NC}"
5155
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
5256

.github/workflows/release-nightly.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ jobs:
142142
cd nightly
143143
python3 ../../revive/.github/scripts/json_generator_nightly.py
144144
cd ..
145+
146+
# Update GitHub Pages file with the JSON data.
147+
chmod +x ../revive/.github/scripts/resolc-bin-gh-pages.sh
148+
bash ../revive/.github/scripts/resolc-bin-gh-pages.sh $PWD
145149
git status
146150
147151
echo "${Green}Add new remote with gh app token${NC}"
@@ -154,7 +158,7 @@ jobs:
154158
git config user.email "ci@parity.io"
155159
git config user.name "${APP_NAME}"
156160
157-
git add nightly/
161+
git add nightly/ index.md
158162
git commit -m "Update nightly json"
159163
git push origin main
160164

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Building Solidity contracts for PolkaVM requires installing the following two co
2121

2222
### `resolc` binary releases
2323

24-
`resolc` is distributed as a standalone binary (with `solc` as the only external dependency). Please download one of our [binary releases](https://github.com/paritytech/revive/releases) for your target platform and mind the platform specific instructions below. We also provide [nightly builds](https://github.com/paritytech/resolc-bin/tree/main/nightly).
24+
`resolc` is distributed as a standalone binary (with `solc` as the only external dependency). Please download one of our [binary releases](https://github.com/paritytech/revive/releases) for your target platform and mind the platform specific instructions below. We also provide [nightly builds](https://paritytech.github.io/resolc-bin/#nightly).
2525

2626
<details>
2727
<summary>MacOS users</summary>
@@ -106,4 +106,3 @@ Please consult the [Developer Guide](https://paritytech.github.io/revive/develop
106106

107107
The revive compiler project, after some early experiments with EVM bytecode translations, decided to fork the `era-compiler` framework.
108108
[Frontend](https://github.com/matter-labs/era-compiler-solidity), [code generator](https://github.com/matter-labs/era-compiler-llvm-context) and some supporting libraries are based of ZKSync `zksolc`. I'd like to express my gratitude and thank the original authors for providing a useable code base under a generous license.
109-

RELEASE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ To create a new pre-release:
1414
4. The release workflow will attempt to build and publish a new pre-release if the latest tag does match the cargo package version.
1515
5. Wait for the `Release` workflow to finish. It should create the pre-release with the same name.
1616
6. Check that pre-release was created on the [Releases page](https://github.com/paritytech/revive/releases) with all artifacts.
17-
7. After the release is published, another workflow should start automatically and update json files in https://github.com/paritytech/resolc-bin. Check the changes.
18-
8. Update the [contract-docs](https://github.com/paritytech/contract-docs/) accordingly
17+
7. After the release is published, another workflow should start automatically and update JSON files in the [resolc-bin repository](https://github.com/paritytech/resolc-bin) as well as render the JSON on its [GitHub Pages website](https://paritytech.github.io/resolc-bin/). Check the changes.
18+
8. Update the [revive compiler book](https://github.com/paritytech/revive/tree/main/book) accordingly.
1919

2020
# `resolc` NPM package release
2121

book/src/faq.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See above, the same applies.
1616

1717
We generally recommend to always use the latest supported version to profit from latest bugfixes, features and performance improvements.
1818

19-
Find out about the latest supported version by running `resolc --supported-solc-versions` or checking [here](https://github.com/paritytech/resolc-bin).
19+
Find out about the latest supported version by running `resolc --supported-solc-versions` or checking [here](https://paritytech.github.io/resolc-bin/).
2020

2121
## Tool `XY` says the contract size is larger than 24kb and will fail to deploy?
2222

@@ -25,4 +25,3 @@ The 24kb code size restriction only exist for the EVM. Our limit is currently ar
2525
## Is `resolc` a drop-in replacement for `solc`?
2626

2727
No. `resolc` aims to work similarly to `solc`, but it's not considered a drop-in replacement.
28-

book/src/user_guide/installation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Building Solidity contracts for PolkaVM requires installing the following two co
77
## `resolc` binary releases
88

99
`resolc` is supported an all major operating systems and installation is straightforward.
10-
Please find our [binary releases](https://github.com/paritytech/revive/releases) for the following platforms:
10+
Please find our [binary releases](https://paritytech.github.io/resolc-bin/) for the following platforms:
1111
- Linux (MUSL)
1212
- MacOS (universal)
1313
- Windows
@@ -24,4 +24,3 @@ We distribute the revive compiler as [node.js module](https://github.com/parityt
2424
## Buidling `resolc` from source
2525

2626
Please follow the build [instructions in the revive `README.md`](https://github.com/paritytech/revive?tab=readme-ov-file#building-from-source).
27-

docs/faq.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ <h2 id="do-you-support-opcode-xy"><a class="header" href="#do-you-support-opcode
183183
<p>See above, the same applies.</p>
184184
<h2 id="in-what-solidity-version-should-i-write-my-dapp"><a class="header" href="#in-what-solidity-version-should-i-write-my-dapp">In what Solidity version should I write my dApp?</a></h2>
185185
<p>We generally recommend to always use the latest supported version to profit from latest bugfixes, features and performance improvements.</p>
186-
<p>Find out about the latest supported version by running <code>resolc --supported-solc-versions</code> or checking <a href="https://github.com/paritytech/resolc-bin">here</a>.</p>
186+
<p>Find out about the latest supported version by running <code>resolc --supported-solc-versions</code> or checking <a href="https://paritytech.github.io/resolc-bin/">here</a>.</p>
187187
<h2 id="tool-xy-says-the-contract-size-is-larger-than-24kb-and-will-fail-to-deploy"><a class="header" href="#tool-xy-says-the-contract-size-is-larger-than-24kb-and-will-fail-to-deploy">Tool <code>XY</code> says the contract size is larger than 24kb and will fail to deploy?</a></h2>
188188
<p>The 24kb code size restriction only exist for the EVM. Our limit is currently around 1mb and may increase further in the future.</p>
189189
<h2 id="is-resolc-a-drop-in-replacement-for-solc"><a class="header" href="#is-resolc-a-drop-in-replacement-for-solc">Is <code>resolc</code> a drop-in replacement for <code>solc</code>?</a></h2>

docs/print.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ <h1 id="installation"><a class="header" href="#installation">Installation</a></h
202202
</ul>
203203
<h2 id="resolc-binary-releases"><a class="header" href="#resolc-binary-releases"><code>resolc</code> binary releases</a></h2>
204204
<p><code>resolc</code> is supported an all major operating systems and installation is straightforward.
205-
Please find our <a href="https://github.com/paritytech/revive/releases">binary releases</a> for the following platforms:</p>
205+
Please find our <a href="https://paritytech.github.io/resolc-bin/">binary releases</a> for the following platforms:</p>
206206
<ul>
207207
<li>Linux (MUSL)</li>
208208
<li>MacOS (universal)</li>
@@ -645,7 +645,7 @@ <h2 id="do-you-support-opcode-xy"><a class="header" href="#do-you-support-opcode
645645
<p>See above, the same applies.</p>
646646
<h2 id="in-what-solidity-version-should-i-write-my-dapp"><a class="header" href="#in-what-solidity-version-should-i-write-my-dapp">In what Solidity version should I write my dApp?</a></h2>
647647
<p>We generally recommend to always use the latest supported version to profit from latest bugfixes, features and performance improvements.</p>
648-
<p>Find out about the latest supported version by running <code>resolc --supported-solc-versions</code> or checking <a href="https://github.com/paritytech/resolc-bin">here</a>.</p>
648+
<p>Find out about the latest supported version by running <code>resolc --supported-solc-versions</code> or checking <a href="https://paritytech.github.io/resolc-bin/">here</a>.</p>
649649
<h2 id="tool-xy-says-the-contract-size-is-larger-than-24kb-and-will-fail-to-deploy"><a class="header" href="#tool-xy-says-the-contract-size-is-larger-than-24kb-and-will-fail-to-deploy">Tool <code>XY</code> says the contract size is larger than 24kb and will fail to deploy?</a></h2>
650650
<p>The 24kb code size restriction only exist for the EVM. Our limit is currently around 1mb and may increase further in the future.</p>
651651
<h2 id="is-resolc-a-drop-in-replacement-for-solc"><a class="header" href="#is-resolc-a-drop-in-replacement-for-solc">Is <code>resolc</code> a drop-in replacement for <code>solc</code>?</a></h2>

0 commit comments

Comments
 (0)