Skip to content

Commit

Permalink
Polishing README (#43)
Browse files Browse the repository at this point in the history
* Remove repeated cargo publish

* Headings and table of contents
  • Loading branch information
mgr0dzicki authored Apr 24, 2023
1 parent 93cab96 commit 3dda482
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ Lint your crate API changes for semver violations.
run: # your `cargo publish` code here
```
# Input options
* [Input options](#input-options)
* [Example scenarios](#example-scenarios)
* [Use in workspaces with a single crate](#use-in-workspaces-with-a-single-crate)
* [Use in workspaces with more than one crate](#use-in-workspaces-with-more-than-one-crate)
* [Customizing baseline rustdoc caching strategy](#customizing-baseline-rustdoc-caching-strategy)
## Input options
Every argument is optional.
Expand All @@ -24,19 +30,19 @@ Every argument is optional.
| `prefix-key` | Additional prefix of the cache key, can be set to start a new cache manually. | |
| `github-token` | The `GITHUB_TOKEN` secret used to download precompiled binaries from GitHub API. If not specified, the [automatic GitHub token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) provided to the workflow will be used. The token may be alternatively passed in an environment variable `GITHUB_TOKEN`. | `${{ github.token }}` |

# Use in workspaces with a single crate
## Example scenarios

### Use in workspaces with a single crate

The action will work out-of-the-box if it is run inside the package root directory. When the package location is different, you have to specify the path to its `Cargo.toml` file:
```yaml
- name: Check semver for my-crate
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
manifest-path: semver/my-crate/Cargo.toml # or just semver/my-crate/
- name: Publish my-crate to crates.io
run: # your `cargo publish` code here
```

# Use in workspaces with more than one crate
### Use in workspaces with more than one crate

By default, if workspace contains multiple crates, all of them are checked for semver violations. You can specify one or more crates to be checked instead using `package`, `exclude` or `manifest-path`.

Expand All @@ -46,17 +52,13 @@ For example, this will check `my-crate-api` and `my-crate-core`:
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: my-crate-api, my-crate-core
- name: Publish my-crate to crates.io
run: # your `cargo publish` code here
```
And this will process all crates from the current workspace except `my-crate-tests`:
```yaml
- name: Check semver for all crates except my-crate-tests
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
exclude: my-crate-tests
- name: Publish my-crate to crates.io
run: # your `cargo publish` code here
```

If the action is not run inside the workspace root directory, you again have to specify the path to its `Cargo.toml` file:
Expand All @@ -65,8 +67,6 @@ If the action is not run inside the workspace root directory, you again have to
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
manifest-path: semver/my-workspace/Cargo.toml # or just semver/my-workspace/
- name: Publish my-workspace to crates.io
run: # your `cargo publish` code here
```

The two above might be also used together:
Expand All @@ -76,11 +76,9 @@ The two above might be also used together:
with:
manifest-path: semver/my-workspace/Cargo.toml # or just semver/my-workspace/
package: my-crate
- name: Publish my-crate to crates.io
run: # your `cargo publish` code here
```

# Customizing baseline rustdoc caching strategy
## Customizing baseline rustdoc caching strategy

The action caches the baseline rustdoc for each package in the workspace. The keys used to distinguish the caches consist of four components:

Expand Down

0 comments on commit 3dda482

Please sign in to comment.