Publish a Rust package or workspace on crates.io. 📦
- name: Release Crates
uses: Systemcluster/actions@release-crates-v0
with:
crates-token: ${{ secrets.CRATES_TOKEN }}
directory: rust-workspace
tag-crate: serde
- Releases a crate or all crates in a workspace to crates.io
- Checks existing releases on crates.io before releasing and skips releases of versions that are already published
- Checks the validity of crates and workspace
- Publishes crates in the correct order when releasing multiple crates based on their dependency on each other
- Optionally creates a tag in the GitHub repository for the release of a specified crate
Name | Type | Description | Default | Required |
---|---|---|---|---|
github-token |
String | GitHub Access Token. | {github.token} |
✓ |
crates-token |
String | Crates.io Access Token. | ✓ | |
tag-crate |
String | Name of the crate for which to create a version tag in the GitHub repository. | ✗ | |
directory |
String | Directory containing the cargo package or workspace. | . |
✗ |
dry-run |
Boolean | Whether to skip publishing changes. | false |
✗ |
allow-dirty |
Boolean | Whether to allow publishing when the working directory is dirty. | false |
✗ |
arguments |
String | Extra arguments for cargo publish. | ✗ | |
only-newest |
Boolean | Whether to only publish crates when no newer version exists. | false |
✗ |
Name | Type | Description |
---|---|---|
published |
String | JSON array containing the names of crates that were published. |
tag |
String | Tag created in the GitHub repository. |
version |
String | Version of the tagged crate that was published. |
This Action requires the following permissions when tag-crate
is set:
permissions:
contents: write