Skip to content

fix: visiabilty value issue #33

fix: visiabilty value issue

fix: visiabilty value issue #33

Workflow file for this run

name: Build and Publish
on:
push:
tags:
- 'v*'
branches:
- 'main'
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Check formatting
run: cargo fmt -- --check
publish:
name: Publish
needs: test
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Update version in Cargo.toml
shell: bash
run: |
VERSION=${GITHUB_REF#refs/tags/v}
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
echo "Updated version to: $VERSION"
grep "^version = " Cargo.toml
- name: Publish to crates.io
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --token "$CARGO_REGISTRY_TOKEN"