-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (37 loc) · 1 KB
/
release_rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: "Release to crates.io"
on:
release:
types: [created]
workflow_dispatch:
jobs:
upload:
runs-on: ubuntu-latest
name: "Upload"
env:
RUST_ICU_MAJOR_VERSION_NUMBER: 70
steps:
- uses: actions/checkout@v3
- name: Install rust
id: rust-install
uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-${{ steps.rust-install.outputs.cachekey }}-cargo
- name: Set Cargo.toml version
shell: bash
working-directory: rust
env:
RELEASE_TAG: ${{ github.ref }}
run: |
mv Cargo.toml Cargo.toml.tmpl
sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" Cargo.toml.tmpl >Cargo.toml
rm Cargo.toml.tmpl
- name: Do The Needful
working-directory: rust
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
cargo publish --allow-dirty