diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6d00ef5..61edaa0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,6 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: dependencies + run: sudo apt update && sudo apt install -y + - name: Set up Go uses: actions/setup-go@v2 with: @@ -39,7 +42,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ ./target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('tools/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - name: install deps run: | diff --git a/.github/workflows/rust_check.yml b/.github/workflows/rust_check.yml index 39a20f7..5321b43 100644 --- a/.github/workflows/rust_check.yml +++ b/.github/workflows/rust_check.yml @@ -16,6 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: dependencies + run: sudo apt update && sudo apt install -y + - name: setup rust uses: actions-rs/toolchain@v1 with: @@ -34,7 +37,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ venus-worker/target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('tools/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - name: lint run: | diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..0c86968 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,55 @@ +name: build for test/release + +on: + push: + branches: [master] + tags: ['**'] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + fetch-depth: '0' + + - name: dependencies + run: sudo apt update && sudo apt install -y + + - name: setup rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: wasm32-unknown-unknown + override: true + components: rustfmt, clippy + + - name: setup build cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ./target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + + - name: Build + run: | + make build + cp target/release/go-fvm-sdk-tools target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64 + + - name: shasum + run: shasum -a 256 target/release/go-fvm-sdk-tools > target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64.sha256 + shell: bash + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64.sha256 + target/release/go-fvm-sdk-tools_${{github.ref_name}}_linux-amd64