-
Notifications
You must be signed in to change notification settings - Fork 25
Show binary releases details on resolc-bin GH Pages site
#447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
533477a
Add script updating resolc-bin's GH Pages file.
elle-j 7e31270
Call gh-pages script in release workflows.
elle-j e7a2ebf
Merge branch 'main' into lj/resolc-bin
elle-j c740a28
Update links docs.
elle-j 5bb4db0
Update compiler book.
elle-j 28bf7a5
Add link to resolc-bin repository on GH Pages site.
elle-j 1d16bf1
Escape backticks in script.
elle-j 755a9e5
Update GH Pages script to take argument instead of expecting ENV.
elle-j 26f28ee
Show data sorted by version in descending order.
elle-j 8f34da5
Apply suggestions from code review
elle-j f04db29
Apply suggestions from code review
elle-j d905430
Minor var name updates.
elle-j 3d4e7fe
Minor update to script.
elle-j 222a671
Render nightly lists last.
elle-j 77aa232
Minor format update.
elle-j File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.