File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
workspace/gh-workflow-gen Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 18
18
name : Build and Test
19
19
env :
20
20
RUSTFLAGS : -Dwarnings
21
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
21
22
on :
22
23
push :
23
24
branches :
49
50
run : cargo +nightly fmt --check
50
51
- name : Cargo Clippy
51
52
run : cargo +nightly clippy --all-features --workspace -- -D warnings
53
+ release :
54
+ needs : build
55
+ name : Release
56
+ runs-on : ubuntu-latest
57
+ steps :
52
58
- name : Release Plz
53
59
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ use gh_workflow_release_plz::ReleasePlz;
3
3
use toolchain:: Toolchain ;
4
4
5
5
fn main ( ) {
6
+ let flags = RustFlags :: deny ( "warnings" ) ;
7
+
6
8
let job = Job :: new ( "Build and Test" )
7
9
. add_step ( Step :: checkout ( ) )
8
10
. add_step (
@@ -28,8 +30,7 @@ fn main() {
28
30
. nightly ( )
29
31
. args ( "--all-features --workspace -- -D warnings" )
30
32
. name ( "Cargo Clippy" ) ,
31
- )
32
- . add_step ( ReleasePlz :: default ( ) ) ;
33
+ ) ;
33
34
34
35
let event = Event :: default ( )
35
36
. push ( Push :: default ( ) . add_branch ( "main" ) )
@@ -41,13 +42,17 @@ fn main() {
41
42
. add_branch ( "main" ) ,
42
43
) ;
43
44
44
- let flags = RustFlags :: deny ( "warnings" ) ;
45
+ let release = Job :: new ( "Release" )
46
+ . add_step ( ReleasePlz :: default ( ) )
47
+ . needs ( "build" ) ;
45
48
46
49
Workflow :: new ( "Build and Test" )
47
- . env ( flags)
50
+ . add_env ( flags)
51
+ . add_env ( ( "GITHUB_TOKEN" , "${{ secrets.GH_TOKEN }}" ) )
48
52
. permissions ( Permissions :: read ( ) )
49
53
. on ( event)
50
54
. add_job ( "build" , job)
55
+ . add_job ( "release" , release)
51
56
. generate ( )
52
57
. unwrap ( ) ;
53
58
}
You can’t perform that action at this time.
0 commit comments