Build #1
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: Build rust package | |
on: | |
workflow_dispatch: | |
inputs: | |
packageVersion: | |
description: 'Package Version' | |
required: true | |
default: '' | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
run: rustup update stable && rustup default stable | |
- name: Update Package Version | |
run: | | |
sed -i '0,/version =/{s/version =.*/version = "${{ github.event.inputs.packageVersion }}"/;}' Cargo.toml | |
- name: Commit, Tag and Push | |
run: | | |
git add Cargo.toml | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git commit -m "chore(package version): updated version" | exit 0 | |
git tag ${{ github.event.inputs.packageVersion }} | |
git push & git push --tags | |
- name: Publish | |
run: | | |
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |