Publish rust crate to crates.io #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish rust crate to crates.io | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_VERSION: 1.74.0 | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
on: | |
workflow_dispatch: | |
inputs: | |
crate: | |
description: Publish crate to crates.io | |
required: true | |
type: choice | |
default: ydb | |
options: | |
- ydb | |
- ydb-grpc | |
- ydb-grpc-helpers | |
version-part: | |
description: "Part of version to changes major.minor.patch (can select patch or minor only)" | |
required: true | |
type: choice | |
default: patch | |
options: | |
- patch | |
- minor | |
permissions: | |
contents: write | |
jobs: | |
publishCrate: | |
runs-on: ubuntu-20.04 | |
env: | |
GIT_EMAIL: ${{ github.actor }}@users.noreply.github.com | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
steps: | |
- name: Install fixed rust version | |
uses: ATiltedTree/setup-rust@v1 | |
with: | |
rust-version: ${{env.RUST_VERSION}} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }} | |
- run: ./.github/scripts/version-up.sh "${{ github.event.inputs.crate }}" "${{ github.event.inputs.version-part }}" "$GIT_EMAIL" |