fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
ea4282ff
patching
1--- 2name : Release Cargo-bazel 3on : 4workflow_dispatch : 5push : 6branches : 7- main 8paths : 9- crate_universe/version.bzl 10 11defaults : 12run : 13shell : bash 14 15jobs : 16validation : 17runs-on : ubuntu-20.04 18steps : 19- uses : actions/checkout@v3 20# TODO: Unfortunately it's not obvious how to restrict `workflow_dispatch` to a particular branch 21# so this step ensures releases are always done off of `main`. 22- name : Ensure branch is 'main' 23run : | 24git fetch origin &> /dev/null 25branch="$(git rev-parse --abbrev-ref HEAD)" 26if [[ "${branch}" != "main" ]]; then 27echo "The release branch must be main. Got '${branch}'' instead." >&2 28exit 1 29else 30echo "Branch is '${branch}'" 31fi 32builds : 33needs : validation 34runs-on : ubuntu-20.04 35steps : 36- uses : actions/checkout@v3 37- name : Install rust toolchains for host 38run : | 39# Detect the current version of rust 40version="$(grep 'DEFAULT_RUST_VERSION =' ./rust/private/common.bzl | grep -o '[[:digit:].]\+')" 41rustup override set "${version}" 42rustup update stable && rustup default stable 43- name : Publish to crates.io 44run : cargo publish --token ${CRATES_TOKEN} 45working-directory : ./crate_universe 46env : 47CRATES_TOKEN : ${{ secrets.CRATES_TOKEN }}