10
10
jobs :
11
11
ci :
12
12
name : CI
13
- needs : [test, fmt, clippy, docs]
13
+ needs : [test, fmt, clippy, docs, release ]
14
14
runs-on : ubuntu-latest
15
15
steps :
16
16
- name : Done
17
17
run : exit 0
18
+ release :
19
+ name : Release
20
+ runs-on : ubuntu-latest
21
+ needs : [test, fmt, clippy, docs]
22
+ steps :
23
+ - uses : actions/checkout@v3
24
+ with :
25
+ submodules : recursive
26
+ fetch-depth : 0 # fetch tags for publish
27
+ # ssh-key: "${{ secrets.COMMIT_KEY }}" # use deploy key to trigger workflow on tag
28
+ - uses : Swatinem/rust-cache@v2
29
+ - run : cargo xtask release
30
+ env :
31
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
18
33
test :
19
34
name : Tests
20
35
strategy :
48
63
uses : actions-rs/cargo@v1
49
64
with :
50
65
command : test
51
- args : --all-targets --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
66
+ args : --all-targets --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}" --workspace
52
67
fmt :
53
68
name : Rustfmt
54
69
runs-on : ubuntu-latest
@@ -91,11 +106,11 @@ jobs:
91
106
with :
92
107
command : clippy
93
108
args : --locked
94
- - name : Run clippy --all-targets --all-features
109
+ - name : Run clippy --all-targets --all-features --workspace
95
110
uses : actions-rs/cargo@v1
96
111
with :
97
112
command : clippy
98
- args : --locked --all-targets --all-features
113
+ args : --locked --all-targets --all-features --workspace
99
114
docs :
100
115
name : Docs
101
116
runs-on : ubuntu-latest
@@ -130,21 +145,3 @@ jobs:
130
145
with :
131
146
command : doc
132
147
args : --locked --no-deps --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
133
- release :
134
- name : Release
135
- runs-on : ubuntu-latest
136
- if : startsWith(github.head_ref, 'release-') || startsWith(github.ref, 'release-')
137
- steps :
138
- - uses : actions/checkout@v2
139
- with :
140
- submodules : false
141
- - uses : actions-rs/toolchain@v1
142
- with :
143
- profile : minimal
144
- toolchain : nightly
145
- override : true
146
- - name : Run dry run publish
147
- uses : actions-rs/cargo@v1
148
- with :
149
- command : publish
150
- args : --dry-run --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
0 commit comments