File tree 1 file changed +49
-17
lines changed 1 file changed +49
-17
lines changed Original file line number Diff line number Diff line change 1
1
name : Rust
2
2
3
+ env :
4
+ CARGO_TERM_COLOR : always
5
+
3
6
on :
7
+ pull_request :
8
+ branches : [ "main", "master", "prod" ]
9
+ tags : [ "v*.*.*" ]
4
10
push :
5
- tags :
6
- - v*.*.*
11
+ branches : [ "main", "master", "prod" ]
12
+ tags : [ " v*.*.*" ]
7
13
schedule :
8
- - cron : ' 30 9 * * 5 '
14
+ - cron : " 30 9 * * * "
9
15
workflow_dispatch :
10
-
11
- env :
12
- CARGO_TERM_COLOR : always
13
- CARGO_REGISTRY_TOKEN : ${CARGO_REGISTRY_TOKEN}
16
+ inputs :
17
+ publish :
18
+ default : true
19
+ description : ' Publish'
20
+ required : true
21
+ type : boolean
14
22
15
23
jobs :
16
- login :
24
+ build :
25
+ name : Build and Test
17
26
runs-on : ubuntu-latest
27
+ strategy :
28
+ matrix :
29
+ toolchain :
30
+ - stable
31
+ - nightly
18
32
steps :
19
- - uses : actions/checkout@v3
20
- - name : Login
21
- run : cargo login ${CARGO_REGISTRY_TOKEN}
22
- build :
33
+ - uses : actions/checkout@v3
34
+ - name : setup
35
+ run : rustup default ${{ matrix.toolchain }}
36
+ - run : cargo build --release -v --workspace
37
+ - run : cargo test --all --all-features --release -v
38
+ features :
39
+ if : ${{ github.event.inputs.publish }}
40
+ name : Features
41
+ needs : build
42
+ runs-on : ubuntu-latest
43
+ strategy :
44
+ matrix :
45
+ package :
46
+ - algae-graph
47
+ - algae-merkle
48
+ - algae-mmr
49
+ steps :
50
+ - uses : actions/checkout@v3
51
+ - name : Publish (${{matrix.package}})
52
+ run : cargo publish --all-features -v -p ${{ matrix.package }} --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
53
+ publish :
54
+ if : ${{ github.event.inputs.publish }}
55
+ name : Publish
56
+ needs : features
23
57
runs-on : ubuntu-latest
24
58
steps :
25
- - uses : actions/checkout@v3
26
- - name : Build
27
- run : cargo build --release --verbose --workspace
28
- - name : Test
29
- run : cargo test --all-features --release --verbose
59
+ - uses : actions/checkout@v3
60
+ - name : Publish (algae)
61
+ run : cargo publish --all-features -v -p algae --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
You can’t perform that action at this time.
0 commit comments