Skip to content

chore: update release workflow 5 #7

chore: update release workflow 5

chore: update release workflow 5 #7

Workflow file for this run

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: Set up GitHub CLI
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure GitHub CLI with the provided token
gh config set -h github.com token $GH_TOKEN
- 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 }}
run: |
# 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"