-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,2 @@ | ||
.git | ||
.github |
This file contains 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,9 @@ | ||
[ | ||
.assets[] | ||
| . as $release | ||
| if (.name | test("dhall-[0-9.]+.*-linux.tar.bz2"; "i")) then | ||
$release.browser_download_url | ||
else | ||
"" | ||
end | ||
] | reduce .[] as $url (""; . + $url) |
This file contains 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,39 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
apk add --quiet --no-progress curl jq | ||
|
||
echo "Installing dhall version: $1" | ||
|
||
url_path=latest | ||
|
||
if [ "$1" != "latest" ] | ||
then | ||
url_path="tags/$1" | ||
fi | ||
|
||
curl -s https://api.github.com/repos/dhall-lang/dhall-haskell/releases/$url_path > releases.json | ||
|
||
core_download_url=$(jq --from-file src/core-release-filter.jq releases.json | tr -d '"') | ||
json_download_url=$(jq --from-file src/json-release-filter.jq releases.json | tr -d '"') | ||
|
||
# Cleanup to make sure the download can't fail | ||
rm -f releases.json | ||
rm -f dhall-* | ||
|
||
echo "Downloading dhall from: $core_download_url" | ||
wget --quiet $core_download_url | ||
|
||
echo "Downloading dhall-json from: $json_download_url" | ||
wget --quiet $json_download_url | ||
|
||
# Extract dhall-json first, makes shell glob easier | ||
tar --extract --bzip2 --file dhall-json-*-linux.tar.bz2 | ||
rm -f dhall-json-*-linux.tar.bz2 | ||
|
||
# Extract dhall now that dhall-json is done | ||
tar --extract --bzip2 --file dhall-*-linux.tar.bz2 | ||
rm -f dhall-*-linux.tar.bz2 | ||
|
||
# Add the dhall executables to the path for future actions | ||
echo "::add-path::$(pwd)/bin" |
This file contains 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,9 @@ | ||
[ | ||
.assets[] | ||
| . as $release | ||
| if (.name | test("dhall-json-[0-9.]+.*-linux.tar.bz2"; "i")) then | ||
$release.browser_download_url | ||
else | ||
"" | ||
end | ||
] | reduce .[] as $url (""; . + $url) |