Download marine with curl (#13)

This commit is contained in:
folex 2021-06-04 16:49:35 +03:00 committed by GitHub
parent 26dd30744c
commit ea5d350f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 7 deletions

View File

@ -12,6 +12,8 @@ jobs:
RUST_BACKTRACE: 1
steps:
- checkout
- run: |
sudo bash .github/download_marine.sh
- restore_cache:
keys:
- aqua-dht04-{{ checksum "Cargo.lock" }}
@ -19,7 +21,6 @@ jobs:
rustup toolchain install nightly-2021-04-24-x86_64-unknown-linux-gnu
rustup default nightly-2021-04-24-x86_64-unknown-linux-gnu
rustup target add wasm32-wasi --toolchain nightly-2021-04-24-x86_64-unknown-linux-gnu
cargo install marine
./build.sh
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory.

14
.github/download_marine.sh vendored Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -o pipefail -o errexit -o nounset
set -x
MARINE_RELEASE="https://api.github.com/repos/fluencelabs/marine/releases/latest"
OUT_DIR=/usr/local/bin
# get metadata about release
curl -s -H "Accept: application/vnd.github.v3+json" $MARINE_RELEASE |
# extract url and name for asset with name "marine"
# also append $OUT_DIR to each name so file is saved to $OUT_DIR
jq -r ".assets | .[] | select(.name == \"marine\") | \"\(.browser_download_url) $OUT_DIR/\(.name)\"" |
# download assets
xargs -n2 bash -c 'curl -L $0 -o $1 && chmod +x $1'

View File

@ -19,6 +19,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download jq
run: |
curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -o /usr/local/bin/jq
chmod +x /usr/local/bin/jq
- name: Download marine
run: bash $GITHUB_WORKSPACE/.github/download_marine.sh
- name: Cache cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache npm
uses: actions/cache@v2
with:
@ -32,17 +49,21 @@ jobs:
distribution: 'adopt'
java-version: '11'
- name: Build .aqua file
working-directory: .
- name: Install Rust
run: |
rustup toolchain install nightly-2021-04-24-x86_64-unknown-linux-gnu
rustup default nightly-2021-04-24-x86_64-unknown-linux-gnu
rustup target add wasm32-wasi --toolchain nightly-2021-04-24-x86_64-unknown-linux-gnu
cargo install marine
./build.sh
cp ./aqua/aqua-dht.aqua ./npm/dht.aqua
### Calculate FINAL_VERSION
- name: Build aqua-dht.wasm
working-directory: .
run: ./build.sh
- name: Build .aqua file
run: |
cp $GITHUB_WORKSPACE/aqua/aqua-dht.aqua $GITHUB_WORKSPACE/npm/dht.aqua
## Calculate FINAL_VERSION
- name: Install deps
run: |
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -