From fe9d18278ba9fd09f26e2e5ddba9a339af60cb4f Mon Sep 17 00:00:00 2001 From: Daniel Olano Date: Mon, 27 Apr 2020 22:36:38 +0200 Subject: [PATCH] Create GH release --- .github/workflows/rust.yml | 51 +++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d240d147..2acbd8ee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,22 +1,43 @@ name: Rust -on: - push: - branches: - - master +on: push jobs: build: - + name: Build project runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - target: wasm32-unknown-unknown - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v2 + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: wasm32-unknown-unknown + # - uses: actions-rs/cargo@v1 + # with: + # command: build + # args: --release + - name: build_foo + run: echo ${{ github.ref }} > foo.txt + - name: Create release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: foo.txt + # files: target/release/node + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}