From 0490731e922c32ef02cd1cad9cf6b5dfc1c58db7 Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Mon, 22 Mar 2021 17:11:31 +0100 Subject: [PATCH 1/4] Update rust.yml --- .github/workflows/rust.yml | 45 ++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fec17ad..0893e71 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,15 +1,52 @@ name: Rust -on: [push] +on: + push: + release: + types: [created] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always jobs: build: - - runs-on: ubuntu-latest + name: Build Rust with Cargo + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + rust: [stable, nightly] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + - name: Set-up Rust + uses: actions-rs/install@v0.1 + with: + version: ${{ matrix.rust }} - name: Build run: cargo build --verbose + - name: Build examples + run: cargo build --examples --verbose - name: Run tests run: cargo test --verbose + + build_success: + name: Build Rust with Cargo - All environments + runs-on: ubuntu-latest + needs: build + steps: + - run: echo Done! + + publish: + name: Publish tagged release on crates.io + if: github.event_name == 'release' && github.event.action == 'created' + needs: + - build_success + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: katyo/publish-crates@v1 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 642e47213665fa42185efdd601e370285c704773 Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Mon, 22 Mar 2021 17:14:29 +0100 Subject: [PATCH 2/4] Update rust.yml Fix Rust set-up action --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0893e71..b2d8081 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,15 +16,15 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - rust: [stable, nightly] + rust: [stable, latest, nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: Set-up Rust - uses: actions-rs/install@v0.1 + - name: Setup Rust + uses: ATiltedTree/setup-rust@v1.0.4 with: - version: ${{ matrix.rust }} + rust-version: ${{ matrix.rust }} - name: Build run: cargo build --verbose - name: Build examples From 0fbe6cbe84fed6e23baa37984e72cecfe4442952 Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Mon, 22 Mar 2021 17:17:08 +0100 Subject: [PATCH 3/4] Update rust.yml --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b2d8081..7a97889 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - rust: [stable, latest, nightly] + rust: [stable, nightly] runs-on: ${{ matrix.os }} steps: From ed038c5825a4a503e7ce382e49a443b5bcfccc4e Mon Sep 17 00:00:00 2001 From: Mark Stopka Date: Mon, 22 Mar 2021 21:31:21 +0100 Subject: [PATCH 4/4] Move to actions-rs/toolchain@v1 action --- .github/workflows/rust.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7a97889..d6b11b9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,9 +22,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Setup Rust - uses: ATiltedTree/setup-rust@v1.0.4 + uses: actions-rs/toolchain@v1 with: - rust-version: ${{ matrix.rust }} + toolchain: ${{ matrix.rust }} + override: true - name: Build run: cargo build --verbose - name: Build examples