Skip to content

Commit fd886e9

Browse files
committed
added cargo publish workflow and bumped to v0.1.1
1 parent 4ef7406 commit fd886e9

3 files changed

Lines changed: 54 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Crate
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*' # Trigger on tags like v0.1.0, v1.0.0-alpha
7+
8+
jobs:
9+
publish:
10+
name: Build and publish crate
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout sources
14+
uses: actions/checkout@v4
15+
16+
- name: Install Rust toolchain
17+
uses: dtolnay/rust-toolchain@stable
18+
with:
19+
components: clippy, rustfmt
20+
21+
- name: Cache dependencies
22+
uses: Swatinem/rust-cache@v2
23+
with:
24+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
25+
26+
- name: Run linters
27+
run: cargo fmt --all && cargo clippy --fix
28+
29+
- name: Run tests
30+
run: cargo test --all-features --verbose
31+
32+
- name: Build in release mode
33+
run: cargo build --release --all-features
34+
35+
- name: Publish to crates.io
36+
if: startsWith(github.ref, 'refs/tags/v') # Only publish on version tags
37+
env:
38+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
39+
run: cargo publish
40+
41+
# Optional: Create a GitHub Release
42+
- name: Create GitHub Release
43+
if: startsWith(github.ref, 'refs/tags/v')
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
files: |
47+
target/release/<your_crate_name_here> # Adjust if you have specific binaries to attach
48+
# Add other assets like README.md, LICENSE, etc.
49+
# You can customize the release notes, name, etc.
50+
# See https://github.com/softprops/action-gh-release for more options
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "strapdown-rs"
33
authors = ["James Brodovsky"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55
edition = "2024"
66
description = "A toolbox for building and analyzing strapdown inertial navigation systems."
77
license = "MIT"

0 commit comments

Comments
 (0)