Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
k-nasa committed Jun 24, 2021
1 parent d795a6a commit 40baf57
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
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 }}
42 changes: 39 additions & 3 deletions README.md
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)
Expand All @@ -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)
84 changes: 84 additions & 0 deletions script/release
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

0 comments on commit 40baf57

Please sign in to comment.