2.6 KiB
2.6 KiB
Release Guide
This guide explains how to publish the soulseek-rs-lib and soulseek-rs crates to crates.io.
Prerequisites
- Create an account on crates.io
- Generate an API token: https://crates.io/me
- Login to cargo:
cargo login <your-token>
Publishing Process
Step 1: Publish the Library First
The client depends on the library, so the library must be published first.
cd soulseek-rs-lib
cargo publish --dry-run # Test the publish
cargo publish # Actually publish
Step 2: Wait for crates.io to Index
After publishing the library, wait 1-2 minutes for crates.io to index it before publishing the client.
Step 3: Update Client Dependency (for releases)
When publishing to crates.io, the client's Cargo.toml should reference the published library version, not the local path.
Edit soulseek-rs/Cargo.toml:
[dependencies]
# For local development:
soulseek-rs-lib = { version = "0.1.0", path = "../soulseek-rs-lib" }
# For publishing (comment out path):
# soulseek-rs-lib = "0.1.0"
Or use both with optional features:
[dependencies]
soulseek-rs-lib = "0.1.0"
[dev-dependencies]
soulseek-rs-lib = { version = "0.1.0", path = "../soulseek-rs-lib" }
Step 4: Publish the Client
cd ../soulseek-rs
cargo publish --dry-run # Test the publish
cargo publish # Actually publish
Version Management
When bumping versions:
- Update the version in root
Cargo.tomlunder[workspace.package] - Both crates will inherit this version automatically
- Publish library first, then client
Automated Releases (Optional)
You can automate this with GitHub Actions. Create .github/workflows/release.yml:
name: Release
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Publish library
run: |
cd soulseek-rs-lib
cargo publish --token ${{ secrets.CARGO_TOKEN }}
- name: Wait for crates.io
run: sleep 60
- name: Publish client
run: |
cd soulseek-rs
cargo publish --token ${{ secrets.CARGO_TOKEN }}
Testing Installation
After publishing, test the installation:
cargo install soulseek-rs
soulseek-rs --help # Should work
For Developers Building Custom Clients
Developers can use the library by adding to their Cargo.toml:
[dependencies]
soulseek-rs-lib = "0.1.0"
They'll get access to all the types and functionality exported in lib.rs.