Skip to content

Commit

Permalink
Enable subkey workflow
Browse files Browse the repository at this point in the history
* subkey: added workflow
* subkey: added latest robonomics,ipci genesis hashes
  • Loading branch information
akru committed Feb 28, 2020
1 parent 0f809a4 commit 7d2e6f1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/subkey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on: [push]

name: Subkey

jobs:
native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Install LLVM (windows only)
if: runner.os == 'Windows'
run: choco install llvm
- uses: hecrj/setup-rust-action@v1
with:
rust-version: 'nightly-2020-02-02'
targets: 'wasm32-unknown-unknown'
- name: Checkout the source code
uses: actions/checkout@master
- name: Check targets are installed correctly
run: rustup target list --installed
- name: Install build tools
run: cargo install --git https://github.com/alexcrichton/wasm-gc --force
- name: Build optimized binary
run: cargo build --release --verbose -p subkey

- name: Upload binary archive into IPFS
if: runner.os != 'Windows'
run: |
cd target/release
tar cfJ subkey-${{ matrix.os }}-x86_64.tar.xz subkey
curl "https://ipfs.infura.io:5001/api/v0/add" -F file=@subkey-${{ matrix.os }}-x86_64.tar.xz
- uses: actions/upload-artifact@master
if: runner.os != 'Windows'
with:
name: subkey-${{ matrix.os }}-x86_64.tar.xz
path: target/release/subkey-${{ matrix.os }}-x86_64.tar.xz

- name: Upload binary archive into IPFS (windows only)
if: runner.os == 'Windows'
run: |
cd target/release
tar czf subkey-${{ matrix.os }}-x86_64.tar.gz subkey.exe
curl "https://ipfs.infura.io:5001/api/v0/add" -F file=@subkey-${{ matrix.os }}-x86_64.tar.gz
- uses: actions/upload-artifact@master
if: runner.os == 'Windows'
with:
name: subkey-${{ matrix.os }}-x86_64.tar.gz
path: target/release/subkey-${{ matrix.os }}-x86_64.tar.gz
3 changes: 2 additions & 1 deletion bin/subkey/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ fn read_required_parameter<T: FromStr>(matches: &ArgMatches, name: &str) -> Resu

fn read_genesis_hash(matches: &ArgMatches) -> Result<H256, Error> {
let genesis_hash: Hash = match matches.value_of("genesis").unwrap_or("ipci") {
"ipci" => hex!["2780b5a875428f4b1eb5e3c3c40114a47a7767c0be52a79fc775d71fa30f3509"].into(),
"ipci" => hex!["1aaf4becb3695d2614481ef68c9c76480a411b89817e3f3d042b5ba2ee836037"].into(),
"robonomics" => hex!["0e653b35f37b3c94b31ca39091b860186734876a0a87d07fde0449e0120e9c27"].into(),
h => Decode::decode(&mut &decode_hex(h)?[..])
.expect("Invalid genesis hash or unrecognised chain identifier"),
};
Expand Down

0 comments on commit 7d2e6f1

Please sign in to comment.