-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.37 KB
/
publish.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
45
46
47
48
49
50
51
52
53
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
CARGO_TERM_COLOR: always
name: Publish
jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml
crates_io_publish:
name: Publish (crates.io)
needs:
- tests
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@stable
- name: cargo-release Cache
id: cargo_release_cache
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-release
key: ${{ runner.os }}-cargo-release
- run: cargo install cargo-release
if: steps.cargo_release_cache.outputs.cache-hit != 'true'
- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
# NOTE :
# allow-branch HEAD is because GitHub actions switches
# to the tag while building, which is a detached head.
# We *could* pass through `--no-verify` so `cargo` doesn't build the crate before publishing,
# which is reasonable, since this job only runs after the Linux, Windows, and WASM builds
# have passed.
- name: "cargo release publish"
run: |-
cargo release \
publish \
--allow-branch HEAD \
--no-confirm \
--no-verify \
--execute