diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9913d8b..49cc0c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' pull_request: workflow_dispatch: @@ -28,3 +30,11 @@ jobs: - name: Run cargo check run: cargo check --all-targets + + - name: Publish to crates.io if new release + if: startsWith(github.ref, 'refs/tags/v') + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo login "$CARGO_REGISTRY_TOKEN" + cargo publish diff --git a/Cargo.toml b/Cargo.toml index 8d5c1ba..4a6eae7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://github.com/spencerwooo/bitsrun-rs" documentation = "https://github.com/spencerwooo/bitsrun-rs" repository = "https://github.com/spencerwooo/bitsrun-rs" readme = "README.md" -keywords = ["bit", "bitsrun", "srun", "srun-client", "srun-login", "beijing-institute-of-technology"] +keywords = ["bit", "bitsrun", "srun", "srun-client", "srun-login"] categories = ["command-line-utilities"] [dependencies] diff --git a/README.md b/README.md index b84cfe0..f171270 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ ## Usage -```shell -❯ bitsrun help +```console +$ bitsrun help A headless login and logout CLI app for 10.0.0.55 at BIT Usage: bitsrun [OPTIONS] [COMMAND] @@ -31,4 +31,4 @@ Options: ## License -[MIT](./LICENSE). +[MIT](./LICENSE)