From b4813dfd0736623ac792ddf1ea91a7e75ba41c3a Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:01:11 -0500 Subject: [PATCH] chore: fix things up --- .github/workflows/ci.yml | 13 ++----------- .github/workflows/release.yml | 12 ++---------- .github/workflows/version.yml | 12 ++---------- Cargo.toml | 4 ++-- 4 files changed, 8 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 374acf7..df3db46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,11 @@ name: CI - on: push: branches: [main] pull_request: branches: [main] - env: CARGO_TERM_COLOR: always - jobs: check: name: Check (${{ matrix.toolchain }}) @@ -17,31 +14,25 @@ jobs: matrix: toolchain: [stable, nightly] steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v6 - name: Install Rust ${{ matrix.toolchain }} uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} components: rustfmt, clippy - - name: Cache cargo registry and build - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }} - - name: Check formatting run: cargo fmt --check - - name: Run clippy run: cargo clippy -- -D warnings - - name: Build run: cargo build - - name: Run tests run: cargo test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 795bd35..423cabc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,38 +1,30 @@ name: Release - on: push: tags: - "v*.*.*" - env: CARGO_TERM_COLOR: always - jobs: publish: name: Publish to crates.io runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v6 - name: Install Rust stable uses: dtolnay/rust-toolchain@stable - - name: Cache cargo registry and build - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.toml') }} - - name: Build release run: cargo build --release - - name: Run tests run: cargo test - - name: Publish to crates.io run: cargo publish env: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index adb8140..28cd5e5 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -1,24 +1,19 @@ name: Version - on: push: branches: [main] - permissions: contents: write - jobs: version: name: Bump version and tag runs-on: ubuntu-latest - # Skip if the push was a version bump commit (prevent infinite loop) if: "!startsWith(github.event.head_commit.message, 'chore(release):')" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - - name: Get latest tag id: latest_tag run: | @@ -28,7 +23,6 @@ jobs: fi echo "tag=$tag" >> "$GITHUB_OUTPUT" echo "Latest tag: $tag" - - name: Determine version bump from commits id: bump run: | @@ -36,7 +30,6 @@ jobs: current="${latest_tag#v}" IFS='.' read -r major minor patch <<< "$current" - # Get commit messages since last tag if git rev-parse "$latest_tag" >/dev/null 2>&1; then commits=$(git log "$latest_tag"..HEAD --pretty=format:"%s") else @@ -49,6 +42,7 @@ jobs: fi bump="none" + while IFS= read -r msg; do if echo "$msg" | grep -qiE '^feat(\(.+\))?!:|^[a-z]+(\(.+\))?!:|BREAKING CHANGE'; then bump="major" @@ -79,14 +73,12 @@ jobs: echo "version=$new_version" >> "$GITHUB_OUTPUT" echo "skip=false" >> "$GITHUB_OUTPUT" echo "Bump: $bump -> v$new_version" - - name: Update Cargo.toml version if: steps.bump.outputs.skip != 'true' run: | new_version="${{ steps.bump.outputs.version }}" sed -i "s/^version = \".*\"/version = \"$new_version\"/" Cargo.toml echo "Updated Cargo.toml to version $new_version" - - name: Commit and tag if: steps.bump.outputs.skip != 'true' run: | diff --git a/Cargo.toml b/Cargo.toml index 7dab729..7a2c24f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "onspring" -version = "0.1.0" +version = "0.0.0" edition = "2021" -description = "Rust SDK for the Onspring API v2" +description = "Rust SDK for the Onspring API" license = "MIT" [dependencies]