-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
3 changed files
with
139 additions
and
3 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,16 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'version' | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: [macos-latest] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Release | ||
run: ./script/release ${{ github.event.inputs.version }} ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
|
||
|
||
|
||
[![CI](https://github.com/k-nasa/wasmi/actions/workflows/ci.yml/badge.svg)](https://github.com/k-nasa/wasmi/actions/workflows/ci.yml) | ||
|
||
# wasmi (in progress) | ||
|
@@ -13,3 +10,42 @@ This is an ongoing project | |
## DEMO | ||
|
||
https://user-images.githubusercontent.com/23740172/123268043-a353e000-d538-11eb-9c9a-bef00b4528e0.mov | ||
|
||
## Usage | ||
|
||
```bash | ||
:) % wasmi -h | ||
wasmi 0.1.0 | ||
k-nasa <[email protected]> | ||
A simple wasm interpreter | ||
|
||
USAGE: | ||
wasmi [OPTIONS] <file-path> --invoke <invoke> | ||
|
||
ARGS: | ||
<file-path> | ||
|
||
FLAGS: | ||
-h, --help Prints help information | ||
-V, --version Prints version information | ||
|
||
OPTIONS: | ||
-a, --args <args>... | ||
-i, --invoke <invoke> | ||
``` | ||
|
||
## Contribution | ||
|
||
1. Fork it ( http://github.com/k-nasa/wasmi ) | ||
2. Create your feature branch (git checkout -b my-new-feature) | ||
3. Commit your changes (git commit -am 'Add some feature') | ||
4. Push to the branch (git push origin my-new-feature) | ||
5. Create new Pull Request | ||
|
||
## Licence | ||
|
||
[MIT](https://github.com/k-nasa/wasmi/blob/master/LICENCE) | ||
|
||
## Author | ||
|
||
[k-nasa](https://github.com/k-nasa) |
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,84 @@ | ||
#!/bin/bash | ||
# This script is used for release binary | ||
# Usage: ./release version GITHUB_TOKEN | ||
|
||
|
||
info () { | ||
printf "\r [ \033[00;34mINFO\033[0m ] $1\n" | ||
} | ||
|
||
success () { | ||
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n" | ||
} | ||
|
||
install_cross() { | ||
cross --version > /dev/null | ||
if [ $? -ne 0 ]; then | ||
info 'cross not found. try install cross' | ||
|
||
cargo install cross | ||
|
||
success "success install cross" | ||
else | ||
info "cross already installed" | ||
fi | ||
} | ||
|
||
install_rgh() { | ||
rgh --version > /dev/null | ||
if [ $? -ne 0 ]; then | ||
info 'rgh not found. try install rgh' | ||
|
||
cargo install rgh | ||
|
||
success "success install rgh" | ||
else | ||
info "rgh already installed" | ||
fi | ||
} | ||
|
||
build_all() { | ||
rm -rf dist/ | ||
|
||
build x86_64-apple-darwin wasmi | ||
build x86_64-unknown-linux-gnu wasmi | ||
} | ||
|
||
build() { | ||
CRATE_NAME=wasmi | ||
MISC="README.md LICENSE" | ||
|
||
TARGET=$1 | ||
BIN_NAME=$2 | ||
DIRNAME=${CRATE_NAME}_${TARGET} | ||
|
||
info "start build ${TARGET} ${BIN_NAME}" | ||
|
||
cross build --target ${TARGET} --release | ||
mkdir -p ${DIRNAME} | ||
\ | ||
cp ./target/${TARGET}/release/${BIN_NAME} ${DIRNAME} | ||
cp ${MISC} ${DIRNAME} | ||
\ | ||
mkdir -p dist | ||
tar czf dist/${DIRNAME}.tar.gz ${DIRNAME} | ||
rm -rf ${DIRNAME} | ||
|
||
success "success build ${TARGET} ${BIN_NAME}" | ||
} | ||
|
||
release() { | ||
VERSION=$1 | ||
GITHUB_TOKEN=$2 | ||
rgh $VERSION ./dist --token $GITHUB_TOKEN | ||
} | ||
|
||
main() { | ||
install_cross | ||
install_rgh | ||
|
||
build_all | ||
release $1 $2 | ||
} | ||
|
||
main $1 $2 |