Skip to content

Commit 27f85c2

Browse files
authored
Merge pull request #31 from SFTtech/milo/crates-io-publishing
crates io publishing
2 parents 245170e + c905e3a commit 27f85c2

9 files changed

Lines changed: 56 additions & 6 deletions

File tree

‎.bumpversion.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ filename = "packages/debmagic-common/Cargo.toml"
6060
search = 'version = "{current_version}"'
6161
replace = 'version = "{new_version}"'
6262

63+
[[tool.bumpversion.files]]
64+
filename = "Cargo.toml"
65+
search = 'debmagic-common = { path = "packages/debmagic-common", version = "{current_version}" }'
66+
replace = 'debmagic-common = { path = "packages/debmagic-common", version = "{new_version}" }'
67+
6368
# Promote notes under [Unreleased] into a dated release section; keep [Unreleased] for the next cycle.
6469
[[tool.bumpversion.files]]
6570
filename = "packages/debmagic/CHANGELOG.md"

‎.github/workflows/release.yaml‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: ./.github/workflows/ci.yaml
1212
secrets: inherit
1313

14-
publish:
14+
publish-pypi:
1515
needs: ci
1616
runs-on: ubuntu-latest
1717
environment:
@@ -43,3 +43,27 @@ jobs:
4343
--compatibility pypi
4444
- name: Publish to PyPI
4545
run: uv publish --trusted-publishing always
46+
47+
publish-crates-io:
48+
needs: ci
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: crates-io-publish
52+
permissions:
53+
id-token: write
54+
contents: read
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v5
58+
- name: Install Rust toolchain
59+
run: rustup show
60+
- uses: Swatinem/rust-cache@v2
61+
- name: Authenticate to crates.io
62+
uses: rust-lang/crates-io-auth-action@v1
63+
id: auth
64+
- name: Publish crates
65+
env:
66+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
67+
run: |
68+
cargo publish -p debmagic-common --locked
69+
cargo publish -p debmagic --locked

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rust-version = "1.89"
88

99
[workspace.dependencies]
1010
# internal
11-
debmagic-common = { path = "packages/debmagic-common" }
11+
debmagic-common = { path = "packages/debmagic-common", version = "0.0.1-alpha.7" }
1212

1313
# third party
1414
clap = { version = ">=4.5.23", features = ["derive"] }

‎docs/develop/releasing.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ below `[Unreleased]`, so those notes become the release notes for the new versio
2525

2626
Then commit, tag, and push. A `v*` tag (e.g. `v0.0.1-alpha.2`) triggers the
2727
[release workflow](../../.github/workflows/release.yaml), which runs
28-
[CI](../../.github/workflows/ci.yaml) first and, on success, builds `debmagic`
29-
(cli) and publishes it to PyPI via Trusted Publishing.
28+
[CI](../../.github/workflows/ci.yaml) first and, on success, publishes in
29+
parallel:
30+
31+
- `debmagic` (cli) to PyPI via Trusted Publishing
32+
- `debmagic-common` then `debmagic` to crates.io via Trusted Publishing
3033

3134
```shell
3235
git push

‎docs/usage/getting-started.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22

33
## Installation
44

5+
### Cargo
6+
7+
```shell
8+
cargo install debmagic
9+
```
10+
511
### Pip
612

713
```shell
814
pip install debmagic
915
```
1016

11-
or directly use uv
17+
or run it directly with uv:
1218

1319
```shell
1420
uvx debmagic

‎packages/debmagic-common/Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[package]
22
name = "debmagic-common"
33
version = "0.0.1-alpha.7"
4+
description = "Shared helpers for debmagic (Debian versions, distro detection)"
5+
license = "GPL-2.0-or-later"
46
documentation = "https://debmagic.readthedocs.org"
57
homepage = "https://github.com/SFTtech/debmagic"
68
repository = "https://github.com/SFTtech/debmagic.git"

‎packages/debmagic/CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- publish the Rust crates to crates.io on tagged releases
11+
- provide a native implementation of the package signing workflow
12+
1013
## [0.0.1-alpha.7] - 2026-08-25
1114

1215
- support non-debian and non-ubuntu distros using dpkg

‎packages/debmagic/Cargo.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[package]
22
name = "debmagic"
33
version = "0.0.1-alpha.7"
4+
description = "modern tooling for building and packaging Debian/Ubuntu packages in isolated environments"
5+
license = "GPL-2.0-or-later"
6+
readme = "README.md"
47
documentation = "https://debmagic.readthedocs.org"
58
homepage = "https://github.com/SFTtech/debmagic"
69
repository = "https://github.com/SFTtech/debmagic.git"

‎packages/debmagic/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ Modern, robust & easy tooling for building and packaging [Debian](https://debian
99

1010
## Installation
1111

12+
```shell
13+
cargo install debmagic
14+
```
15+
1216
```shell
1317
pip install debmagic
1418
```
1519

16-
or run it directly:
20+
or run it directly with uv:
1721

1822
```shell
1923
uvx debmagic

0 commit comments

Comments
 (0)