Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git_components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ config:
tests:
owners:
- artiepoole
snapcraft:
owners:
- artiepoole
23 changes: 23 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,29 @@ jobs:
echo "::group::yamlfmt output"
yamlfmt -lint .
echo "::endgroup::"
version-bump-check:
name: Check Version Bump for Rust Changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Ensure version is bumped if there are any rust changes
id: check-rust-changes
run: |
set -e
# Check if any .rs files in <package>/src/ directories have been modified
changed_rust_files=$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.base_ref }} | grep -E "^(daemon|cli|fpgad_macros)/src/.*\.rs$" || true)

if [ -z "$changed_rust_files" ]; then
echo "✅ No Rust source files modified - version bump not required."
exit 0
else
echo "::group::Modified Rust source files"
echo "${changed_rust_files}"
echo "::endgroup::"
python scripts/ci/check_version_bump.py
fi
rust-check:
name: Check Rust Code
runs-on: ubuntu-latest
Expand Down
50 changes: 25 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
[workspace]
resolver = "3"
members = ["daemon", "cli", "fpgad_macros"]

[workspace.package]
version = "0.1.0"
edition = "2024"
license = "GPL-3.0"
homepage = "https://github.com/canonical/fpgad"
repository = "https://github.com/canonical/fpgad"
authors = ["Talha Can Havadar <talha.can.havadar@canonical.com>", "Artie Poole <stuart.poole@canonical.com>"]

[workspace.dependencies]
fpgad_macros = { path = "fpgad_macros" }

75 changes: 75 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Publishing Guide for FPGAd

This document explains how to publish the FPGAd packages to crates.io.

## Package Structure

The workspace contains 3 packages:

1. **`fpgad_macros`** - Procedural macros (must be published first)
2. **`fpgad`** - The daemon (depends on fpgad_macros)
3. **`fpgad_cli`** - Command-line interface

## Publication Order

Packages must be published in this order due to dependencies:

1. `fpgad_macros` (no dependencies on other workspace crates)
2. `fpgad` (depends on fpgad_macros)
3. `fpgad_cli` (no dependencies on other workspace crates, but logically depends on daemon)

## Pre-publication Checklist

- [ ] All packages have proper metadata (version, license, description, etc.)
- [ ] All packages have README.md files
- [ ] Workspace-level metadata is shared across packages
- [ ] Dependencies have version requirements specified
- [ ] All packages compile successfully
- [ ] All tests pass (CI auto runs on PR)
- [ ] Documentation is complete
- [ ] CHANGELOG is up to date
- [ ] Git repository is clean

## Publishing Commands

### 1. Publish fpgad_macros

```bash
cd fpgad_macros
cargo publish
```

### 2. Publish fpgad

```bash
cd daemon
cargo publish
```

### 3. Publish fpgad_cli

```bash
cd cli
cargo publish
```

## Dry Run Testing

Before publishing, test with dry-run:

```bash
cargo publish --dry-run
```

## Version Updates

When releasing new versions, update the version in the workspace `Cargo.toml`:

```toml
[workspace.package]
version = "X.Y.Z" # Update this
```

All packages will inherit this version.

Note that the CI pipeline will enforce an increase in the version whenever contents of a .rs file inside <part>/src is changed, before the commits can be merged.
18 changes: 15 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
[package]
name = "cli"
version = "0.1.0"
edition = "2024"
name = "fpgad_cli"
version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
description = "Command-line interface for interacting with the FPGAd daemon"
readme = "README.md"
keywords = ["fpga", "cli", "embedded", "hardware", "xilinx"]
categories = ["command-line-utilities", "hardware-support"]

[[bin]]
name = "fpgad_cli"
path = "src/main.rs"

[dependencies]
clap = { version = "4.5.41", features = ["derive"] }
Expand Down
17 changes: 10 additions & 7 deletions daemon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[package]
name = "daemon"
version = "0.1.0"
edition = "2024"
license = "GPL-3.0"
name = "fpgad"
version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
description = "An FPGA manager daemon that handles the dirty work for you."
homepage = "https://github.com/talhaHavadar/fpgad"
repository = "https://github.com/talhaHavadar/fpgad"
readme = "README.md"
keywords = ["fpga", "daemon", "embedded", "hardware", "xilinx"]
categories = ["hardware-support", "embedded"]

[features]
default = ["softeners-all"]
Expand All @@ -15,7 +18,7 @@ softeners = []
xilinx-dfx-mgr = ["softeners"]

[dependencies]
fpgad_macros = { path = "../fpgad_macros" }
fpgad_macros = { workspace = true }
log = "0.4.27"
env_logger = "0.11.8"
tokio = { version = "1.47.0", features = ["full"] }
Expand Down
12 changes: 10 additions & 2 deletions fpgad_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
[package]
name = "fpgad_macros"
version = "0.1.0"
edition = "2024"
version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
description = "Procedural macros for the FPGAd project"
readme = "README.md"
keywords = ["fpga", "macros", "proc-macro"]
categories = ["development-tools::procedural-macro-helpers"]

[lib]
proc-macro = true
Expand Down
Loading
Loading