Skip to content

Commit

Permalink
Added action to publish to crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
tluijken committed Dec 21, 2023
1 parent c68b5eb commit 071075c
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/cargo-build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
on: [push]

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
Expand All @@ -11,9 +16,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
override: true
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
name: cargo update
with:
Expand All @@ -23,7 +26,16 @@ jobs:
with:
command: test

# - uses: actions-rs/cargo@v1
# with:
# command: build
# args: --release --all-features
publish_to_crates_io:
needs: build_and_test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
name: "Publish to crates.io"
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 }}

0 comments on commit 071075c

Please sign in to comment.