diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea9e675..8808d98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,8 @@ jobs: run: cargo clippy --all-targets -- -D warnings - name: Install taplo toml toolkit run: cargo install --locked --version 0.10.0 taplo-cli + - name: Run taplo check + run: taplo fmt --check --diff build_and_test: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..086dca3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +# Copyright (c) 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 + +name: Release + +on: + push: + tags: + - v* + +concurrency: + group: "release-${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + cargo-publish: + permissions: + content: read + name: publish to crates.io + # This will publish to crates.io if secrets.CRATES_TOKEN is set in the workspace, otherwise do a dry-run + runs-on: ubuntu-latest + needs: + - tag_release_artifacts + env: + CRATES_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: false + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain + with: + toolchain: 1.88.0 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + - uses: ./.github/actions/setup-dlt + - name: Publish to crates.io + run: | + PUBLISH_ARGS="--all-features" + if [ -z "$CRATES_TOKEN" ]; then + PUBLISH_ARGS="$PUBLISH_ARGS --dry-run" + else + PUBLISH_ARGS="$PUBLISH_ARGS --token ${CRATES_TOKEN}" + fi + cargo publish $PUBLISH_ARGS + env: + RUSTFLAGS: "-L /usr/local/lib" + PKG_CONFIG_PATH: "/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" diff --git a/Cargo.toml b/Cargo.toml index 6489410..9d9c128 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,8 +20,8 @@ members = ["dlt-sys", "dlt-rs", "tracing-dlt", "integration-tests"] [workspace.dependencies] tracing-dlt = { path = "tracing-dlt" } -dlt-sys = { path = "dlt-sys" } -dlt-rs = { path = "dlt-rs" } +dlt-sys = { path = "dlt-sys", version = "0.1.0" } +dlt-rs = { path = "dlt-rs", version = "0.1.0" } integration-tests = { path = "integration-tests" } # ---- common crates ---- diff --git a/dlt-rs/Cargo.toml b/dlt-rs/Cargo.toml index ab045c7..d47ed57 100644 --- a/dlt-rs/Cargo.toml +++ b/dlt-rs/Cargo.toml @@ -25,7 +25,7 @@ workspace = true path = "src/lib.rs" [dependencies] -dlt-sys = { workspace = true } +dlt-sys = { workspace = true, version = "0.1.0" } # external tokio = { workspace = true } diff --git a/tracing-dlt/Cargo.toml b/tracing-dlt/Cargo.toml index a7dc679..8e2cc04 100644 --- a/tracing-dlt/Cargo.toml +++ b/tracing-dlt/Cargo.toml @@ -26,7 +26,7 @@ path = "src/lib.rs" [dependencies] # internal dependencies -dlt-rs = { workspace = true } +dlt-rs = { workspace = true, version = "0.1.0" } # external tokio = { workspace = true }