1
+ name : Rust Package
2
+
3
+ on :
4
+ push :
5
+ branches : [ "master" ]
6
+ pull_request :
7
+ branches : [ "master" ]
8
+ workflow_dispatch :
9
+ inputs :
10
+ ref :
11
+ description : ' The reference (branch/tag/commit) to checkout'
12
+ required : false
13
+ release-type :
14
+ type : choice
15
+ required : false
16
+ default : ' none'
17
+ description : ' Indicates whether we want to make a release and if which one'
18
+ options :
19
+ - release
20
+ - none
21
+
22
+ concurrency :
23
+ group : ${{ github.workflow }}-${{ github.ref }}
24
+ cancel-in-progress : true
25
+
26
+ jobs :
27
+ build-and-test :
28
+ name : Build and Test
29
+ runs-on : ${{ matrix.os }}
30
+ strategy :
31
+ matrix :
32
+ include :
33
+ - target : x86_64-unknown-linux-gnu
34
+ os : ubuntu-latest
35
+ - target : aarch64-unknown-linux-gnu
36
+ os : linux-arm64
37
+ - target : x86_64-apple-darwin
38
+ os : macos-13
39
+ - target : aarch64-apple-darwin
40
+ os : macos-14
41
+ - target : x86_64-pc-windows-gnu
42
+ os : windows-latest
43
+
44
+ steps :
45
+ - name : Checkout sources
46
+ uses : actions/checkout@v4
47
+ with :
48
+ ref : ${{ inputs.ref || github.ref }}
49
+
50
+ - name : Setup toolchain
51
+ uses : dtolnay/rust-toolchain@master
52
+ with :
53
+ toolchain : stable
54
+ target : ${{ matrix.target }}
55
+
56
+ - name : Build
57
+ run : cargo build --target ${{ matrix.target }} --verbose
58
+
59
+ - name : Run tests
60
+ run : cargo test --target ${{ matrix.target }} --verbose
61
+
62
+ publish :
63
+ name : Publish in order
64
+ needs : build-and-test
65
+ if : ${{ inputs.release-type != 'none' && github.event_name == 'workflow_dispatch' }}
66
+ runs-on : ubuntu-latest
67
+ steps :
68
+ - name : Checkout sources
69
+ uses : actions/checkout@v4
70
+ with :
71
+ ref : ${{ inputs.ref || github.ref }}
72
+
73
+ - name : Setup toolchain
74
+ uses : dtolnay/rust-toolchain@master
75
+ with :
76
+ toolchain : stable
77
+
78
+ # These steps are in a specific order so crate dependencies are updated first
79
+ - name : Publish bls12_381
80
+ run : cargo publish --package crate_crypto_internal_eth_kzg_bls12_381
81
+ env :
82
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
83
+
84
+ - name : Publish polynomial
85
+ run : cargo publish --package crate_crypto_internal_eth_kzg_polynomial
86
+ env :
87
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
88
+
89
+ - name : Publish erasure_codes
90
+ run : cargo publish --package crate_crypto_internal_eth_kzg_erasure_codes
91
+ env :
92
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
93
+
94
+ - name : Publish kzg_multi_open
95
+ run : cargo publish --package crate_crypto_kzg_multi_open_fk20
96
+ env :
97
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
98
+
99
+ - name : Publish eip7594
100
+ run : cargo publish --package eip7594
101
+ env :
102
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_RELEASE_TOKEN }}
0 commit comments