File tree 4 files changed +27
-15
lines changed
4 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 42
42
# upgrade_stwo: ${{ inputs.upgrade_stwo }}
43
43
include-cairols : ${{ inputs.include-cairols }}
44
44
include-stwo : ${{ inputs.include-stwo }}
45
- include-lint : ${{ inputs.include-lint }}
45
+ include-lint : ${{ inputs.include-lint }}
46
+ is_dev : true
Original file line number Diff line number Diff line change 49
49
description : " Include CairoLint in build"
50
50
type : boolean
51
51
default : true
52
+ is_dev :
53
+ description : " Is this a dev build"
54
+ type : boolean
55
+ default : false
52
56
schedule :
53
57
- cron : ' 0 0 * * 3,6'
54
58
99
103
- name : Determine nightly version
100
104
id : version
101
105
shell : bash
106
+ env :
107
+ IS_SCARB_DEV : ${{ inputs.is_dev }}
102
108
run : |
103
109
NIGHTLY_TAG=$(cargo xtask get-nightly-version --tag)
104
110
NIGHTLY_VERSION=$(cargo xtask get-nightly-version)
@@ -119,6 +125,8 @@ jobs:
119
125
run : cargo build -p xtask
120
126
121
127
- name : Compose release notes
128
+ env :
129
+ IS_SCARB_DEV : ${{ inputs.is_dev }}
122
130
run : cargo xtask nightly-release-notes > NIGHTLY_RELEASE_NOTES.md
123
131
124
132
- name : Commit patches
Original file line number Diff line number Diff line change @@ -8,30 +8,33 @@ use time::OffsetDateTime;
8
8
pub struct Args {
9
9
#[ arg( short, long) ]
10
10
tag : bool ,
11
+ #[ arg( long, env = "IS_SCARB_DEV" ) ]
12
+ dev : bool ,
11
13
}
12
14
13
15
pub fn main ( args : Args ) -> Result < ( ) > {
14
- let tag = nightly_tag ( ) ;
16
+ let tag = nightly_tag ( args . dev ) ;
15
17
if args. tag {
16
18
println ! ( "{tag}" ) ;
17
19
} else {
18
- let version = nightly_version ( ) ?;
20
+ let version = nightly_version ( args . dev ) ?;
19
21
println ! ( "{version}" ) ;
20
22
}
21
23
Ok ( ( ) )
22
24
}
23
25
24
- pub fn nightly_version ( ) -> Result < Version > {
26
+ pub fn nightly_version ( is_dev : bool ) -> Result < Version > {
25
27
let mut version = expected_version ( ) ?;
26
28
version. pre = Prerelease :: EMPTY ;
27
- version. build = BuildMetadata :: new ( & nightly_tag ( ) ) . unwrap ( ) ;
29
+ version. build = BuildMetadata :: new ( & nightly_tag ( is_dev ) ) . unwrap ( ) ;
28
30
Ok ( version)
29
31
}
30
32
31
- pub fn nightly_tag ( ) -> String {
33
+ pub fn nightly_tag ( is_dev : bool ) -> String {
34
+ let prefix = if is_dev { "dev" } else { "nightly" } ;
32
35
let dt = OffsetDateTime :: now_utc ( ) ;
33
36
format ! (
34
- "nightly -{}-{:0>2}-{:0>2}" ,
37
+ "{prefix} -{}-{:0>2}-{:0>2}" ,
35
38
dt. year( ) ,
36
39
u8 :: from( dt. month( ) ) ,
37
40
dt. day( )
Original file line number Diff line number Diff line change 1
1
use anyhow:: Result ;
2
2
use clap:: Parser ;
3
- use xshell:: { cmd , Shell } ;
3
+ use xshell:: { Shell , cmd } ;
4
4
5
5
use crate :: get_nightly_version:: nightly_version;
6
6
7
7
#[ derive( Parser ) ]
8
- pub struct Args ;
8
+ pub struct Args {
9
+ #[ arg( long, env = "IS_SCARB_DEV" ) ]
10
+ dev : bool ,
11
+ }
9
12
10
- pub fn main ( _ : Args ) -> Result < ( ) > {
13
+ pub fn main ( args : Args ) -> Result < ( ) > {
11
14
// Note: We do not use scarb-build-metadata here because it requires rebuilding xtasks.
12
15
13
16
let sh = Shell :: new ( ) ?;
14
17
15
- let version = nightly_version ( ) ?;
18
+ let version = nightly_version ( args . dev ) ?;
16
19
17
20
let scarb_commit = cmd ! ( sh, "git log -1 --date=short --format=%H" ) . read ( ) ?;
18
21
@@ -28,10 +31,7 @@ pub fn main(_: Args) -> Result<()> {
28
31
. unwrap ( )
29
32
. iter ( )
30
33
. find ( |node| {
31
- let repr = node. get ( "id" )
32
- . unwrap ( )
33
- . as_str ( )
34
- . unwrap ( ) ;
34
+ let repr = node. get ( "id" ) . unwrap ( ) . as_str ( ) . unwrap ( ) ;
35
35
// The first condition for Rust >= 1.77
36
36
// (After the PackageId spec stabilization)
37
37
// The second condition for Rust < 1.77
You can’t perform that action at this time.
0 commit comments