-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.54 KB
/
release.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
on:
workflow_run:
workflows:
- 'tests'
types:
- 'completed'
branches:
- 'main'
name: Create Release
permissions:
contents: write
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
created: ${{ steps.create_release_step.outputs.created }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: "cargo check"
run: |
cargo check
- name: "create release"
id: create_release_step
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bash .github/create_rel.sh
crates_io_publish:
name: Publish (crates.io)
needs: create_release
if: needs.create_release.outputs.created == 1
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: cargo-release Cache
id: cargo_release_cache
uses: actions/cache@v3
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 }}
- name: "cargo release publish"
run: |-
cargo release \
publish \
--workspace \
--all-features \
--allow-branch main \
--no-confirm \
--execute