mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-20 18:56:17 +00:00
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>
This commit is contained in:
1 parent
81ce306735
commit
55c4e32b82
11 files changed
+174
-14
No files matched your search
@@ -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
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $linux)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
## MacOS
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $macos)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
## Wasm
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $wasm)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
## Windows
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $windows)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
## Nightly
|
||||
|
||||
### Linux
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $nightly_linux)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
### MacOS
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $nightly_macos)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
### Wasm
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $nightly_wasm)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
|
||||
### Windows
|
||||
|
||||
<details>
|
||||
<summary>See builds</summary>
|
||||
|
||||
{% highlight json %}
|
||||
$(sort_by_version_descending $nightly_windows)
|
||||
{% endhighlight %}
|
||||
|
||||
</details>
|
||||
EOF
|
||||
|
||||
echo "File has been updated!"
|
||||
Reference in new issue
Block a user