chore: update release workflow 7 #9
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: release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: ATiltedTree/setup-rust@v1 | |
with: | |
rust-version: stable | |
- name: Install cargo-release | |
run: cargo install cargo-release | |
- name: Create GitHub release & Publish to crates.io | |
env: | |
CRATE_NAME: blockchain-cli | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
run: | | |
# Set | |
git config --global user.email "slavpas@gmail.com" | |
git config --global user.name "Slavik Pastushenko" | |
# Bump the version and create a GitHub release | |
cargo release --execute --no-confirm patch | |
# Get the version number from Cargo.toml | |
VERSION=$(grep -oP 'version = "\K[^"]+' Cargo.toml) | |
# Create a GitHub release using the GitHub CLI | |
gh release create v$VERSION target/package/blockchain-cli-*.crate -t "v$VERSION" |