Skip to content

Outlines Core v0.1.23 #34

Outlines Core v0.1.23

Outlines Core v0.1.23 #34

Workflow file for this run

name: Release Rust Package
on:
release:
types:
- created
jobs:
release-rust:
name: Build and publish on crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Bump Cargo version
run: |
python ./.github/scripts/cargo_version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache Cargo dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check Cargo.toml version matches Release tag
run: |
CARGO_VERSION=$(grep '^version =' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
if [ "${GITHUB_REF#refs/tags/}" != "$CARGO_VERSION" ]; then
echo "Version mismatch: Cargo.toml ($CARGO_VERSION) doesn't match Release tag (${GITHUB_REF#refs/tags/})"
exit 1
fi
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# We need --allow-dirty since we dynamically change the version in Cargo.toml
run: cargo publish --allow-dirty