diff --git a/.github/scripts/resolc-bin-gh-pages.sh b/.github/scripts/resolc-bin-gh-pages.sh new file mode 100644 index 0000000..887f13e --- /dev/null +++ b/.github/scripts/resolc-bin-gh-pages.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +# This script updates `index.md` in the GitHub Pages root directory provided +# by the required argument to be passed. The file will be updated to simply +# render the `resolc-bin` JSON data for each of the supported platforms. +# `index.md` is the file served by GitHub Pages after being built by Jekyll +# and the Markdown processed by kramdown. + +set -exo pipefail + +gh_pages_root_dir="$1" +if [ -z "$gh_pages_root_dir" ]; then + echo "Error: The path to the GitHub Pages root directory must be passed" + exit 1 +fi + +linux="$gh_pages_root_dir/linux/list.json" +macos="$gh_pages_root_dir/macos/list.json" +wasm="$gh_pages_root_dir/wasm/list.json" +windows="$gh_pages_root_dir/windows/list.json" +nightly_linux="$gh_pages_root_dir/nightly/linux/list.json" +nightly_macos="$gh_pages_root_dir/nightly/macos/list.json" +nightly_wasm="$gh_pages_root_dir/nightly/wasm/list.json" +nightly_windows="$gh_pages_root_dir/nightly/windows/list.json" + +build_info_files=("$linux" "$macos" "$wasm" "$windows" "$nightly_linux" + "$nightly_macos" "$nightly_wasm" "$nightly_windows") + +for file in "${build_info_files[@]}"; do + if [ ! -f "$file" ]; then + echo "Error: File does not exist - $file" + exit 1 + fi +done + +# Sort the data by version in descending order. +sort_by_version_descending() { + local build_info_file="$1" + if [ -z "$build_info_file" ]; then + echo "Error: A file path argument is required for sorting" + return 1 + fi + + # Load the data and sort builds and releases with the latest version first. + data=$(jq '.' "$build_info_file") + sorted_data=$(echo "$data" | jq '.builds = (.builds | sort_by(.version) | reverse) | + .releases = (.releases | to_entries | sort_by(.key) | reverse | from_entries)') + + echo "$sorted_data" | jq . +} + +echo "Updating GitHub Pages index.md file..." + +cat > "$gh_pages_root_dir/index.md" << EOF +--- +title: resolc-bin +--- + +# resolc-bin + +Listed here are details about the \`resolc\` binary releases for the supported platforms. +The information is synced with the [resolc-bin GitHub repository](https://github.com/paritytech/resolc-bin). + +## Linux + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $linux) +{% endhighlight %} + +
+ +## MacOS + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $macos) +{% endhighlight %} + +
+ +## Wasm + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $wasm) +{% endhighlight %} + +
+ +## Windows + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $windows) +{% endhighlight %} + +
+ +## Nightly + +### Linux + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $nightly_linux) +{% endhighlight %} + +
+ +### MacOS + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $nightly_macos) +{% endhighlight %} + +
+ +### Wasm + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $nightly_wasm) +{% endhighlight %} + +
+ +### Windows + +
+ See builds + +{% highlight json %} +$(sort_by_version_descending $nightly_windows) +{% endhighlight %} + +
+EOF + +echo "File has been updated!" diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index eda5aaf..ea2a2a4 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -37,6 +37,6 @@ jobs: - name: Compare with committed docs run: | if ! diff -r docs-tmp docs 2>/dev/null; then - echo "docs/ is not up-to-date. Run make test-book and commit the docs/ directory" + echo "docs/ is not up-to-date. Run \`make book\` and commit the docs/ directory" exit 1 fi diff --git a/.github/workflows/generate_versions.yml b/.github/workflows/generate_versions.yml index 4055a49..57a6779 100644 --- a/.github/workflows/generate_versions.yml +++ b/.github/workflows/generate_versions.yml @@ -47,6 +47,10 @@ jobs: cd resolc-bin python ../tmp/.github/scripts/json_generator.py ${GITHUB_REPOSITORY} ${{ github.event.release.tag_name }} + # Update GitHub Pages file with the JSON data. + chmod +x ../tmp/.github/scripts/resolc-bin-gh-pages.sh + bash ../tmp/.github/scripts/resolc-bin-gh-pages.sh $PWD + echo "${Green}Add new remote with gh app token${NC}" git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g") diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index b888629..8a415bd 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -142,6 +142,10 @@ jobs: cd nightly python3 ../../revive/.github/scripts/json_generator_nightly.py cd .. + + # Update GitHub Pages file with the JSON data. + chmod +x ../revive/.github/scripts/resolc-bin-gh-pages.sh + bash ../revive/.github/scripts/resolc-bin-gh-pages.sh $PWD git status echo "${Green}Add new remote with gh app token${NC}" @@ -154,7 +158,7 @@ jobs: git config user.email "ci@parity.io" git config user.name "${APP_NAME}" - git add nightly/ + git add nightly/ index.md git commit -m "Update nightly json" git push origin main diff --git a/README.md b/README.md index 263ab24..06b6f9f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Building Solidity contracts for PolkaVM requires installing the following two co ### `resolc` binary releases -`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). +`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).
MacOS users @@ -106,4 +106,3 @@ Please consult the [Developer Guide](https://paritytech.github.io/revive/develop The revive compiler project, after some early experiments with EVM bytecode translations, decided to fork the `era-compiler` framework. [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. - diff --git a/RELEASE.md b/RELEASE.md index 439f544..f4c082a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -14,8 +14,8 @@ To create a new pre-release: 4. The release workflow will attempt to build and publish a new pre-release if the latest tag does match the cargo package version. 5. Wait for the `Release` workflow to finish. It should create the pre-release with the same name. 6. Check that pre-release was created on the [Releases page](https://github.com/paritytech/revive/releases) with all artifacts. -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. -8. Update the [contract-docs](https://github.com/paritytech/contract-docs/) accordingly +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. +8. Update the [revive compiler book](https://github.com/paritytech/revive/tree/main/book) accordingly. # `resolc` NPM package release diff --git a/book/src/faq.md b/book/src/faq.md index f156473..73ed376 100644 --- a/book/src/faq.md +++ b/book/src/faq.md @@ -16,7 +16,7 @@ See above, the same applies. We generally recommend to always use the latest supported version to profit from latest bugfixes, features and performance improvements. -Find out about the latest supported version by running `resolc --supported-solc-versions` or checking [here](https://github.com/paritytech/resolc-bin). +Find out about the latest supported version by running `resolc --supported-solc-versions` or checking [here](https://paritytech.github.io/resolc-bin/). ## Tool `XY` says the contract size is larger than 24kb and will fail to deploy? @@ -25,4 +25,3 @@ The 24kb code size restriction only exist for the EVM. Our limit is currently ar ## Is `resolc` a drop-in replacement for `solc`? No. `resolc` aims to work similarly to `solc`, but it's not considered a drop-in replacement. - diff --git a/book/src/user_guide/installation.md b/book/src/user_guide/installation.md index 754c8e8..b4b315d 100644 --- a/book/src/user_guide/installation.md +++ b/book/src/user_guide/installation.md @@ -7,7 +7,7 @@ Building Solidity contracts for PolkaVM requires installing the following two co ## `resolc` binary releases `resolc` is supported an all major operating systems and installation is straightforward. -Please find our [binary releases](https://github.com/paritytech/revive/releases) for the following platforms: +Please find our [binary releases](https://paritytech.github.io/resolc-bin/) for the following platforms: - Linux (MUSL) - MacOS (universal) - Windows @@ -24,4 +24,3 @@ We distribute the revive compiler as [node.js module](https://github.com/parityt ## Buidling `resolc` from source Please follow the build [instructions in the revive `README.md`](https://github.com/paritytech/revive?tab=readme-ov-file#building-from-source). - diff --git a/docs/faq.html b/docs/faq.html index 765b8a3..5918d88 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -183,7 +183,7 @@

See above, the same applies.

In what Solidity version should I write my dApp?

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

-

Find out about the latest supported version by running resolc --supported-solc-versions or checking here.

+

Find out about the latest supported version by running resolc --supported-solc-versions or checking here.

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

The 24kb code size restriction only exist for the EVM. Our limit is currently around 1mb and may increase further in the future.

Is resolc a drop-in replacement for solc?

diff --git a/docs/print.html b/docs/print.html index 0e8c2f0..47414c5 100644 --- a/docs/print.html +++ b/docs/print.html @@ -202,7 +202,7 @@

resolc binary releases

resolc is supported an all major operating systems and installation is straightforward. -Please find our binary releases for the following platforms:

+Please find our binary releases for the following platforms:

resolc binary releases

resolc is supported an all major operating systems and installation is straightforward. -Please find our binary releases for the following platforms:

+Please find our binary releases for the following platforms: