Skip to content

Fixed the workflow #115

Fixed the workflow

Fixed the workflow #115

name: Cargo build and test
on:
push:
branches: [ develop, master, release/**, hotfix/** ]
pull_request:
branches: [ develop, master, release/**, hotfix/** ]
jobs:
build_and_test:
name: Build and test Stellar SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
name: cargo update
with:
command: update
- uses: actions-rs/cargo@v1
name: cargo test
with:
command: test
publish_to_crates_io:
name: "Publish to crates.io"
runs-on: ubuntu-latest
needs: build_and_test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}