@@ -18,20 +18,18 @@ jobs:
18
18
extra-param : # nothing
19
19
steps :
20
20
- name : Checkout Rodbus
21
- uses : actions/checkout@v3
21
+ uses : actions/checkout@v4
22
22
with :
23
23
repository : stepfunc/rodbus
24
- ref : 1.3.1
24
+ ref : 1.4.0
25
25
- name : Install Rust
26
- uses : actions-rs/ toolchain@v1
26
+ uses : dtolnay/rust- toolchain@stable
27
27
with :
28
- profile : minimal
29
28
toolchain : stable
30
- override : true
31
29
- name : Create FFI modules dir
32
30
run : mkdir ffi-modules\${{ matrix.target }}
33
31
- name : Build FFI
34
- run : cargo build --release -p rodbus-ffi --no-default-features --features tls --target ${{ matrix.target }} --message-format json | Out-File -encoding "UTF8" .\ffi-modules\${{ matrix.target }}\build.log
32
+ run : cargo build --release -p rodbus-ffi --no-default-features --features tls --target ${{ matrix.target }}
35
33
- name : Copy .dll
36
34
run : cp .\target\${{ matrix.target }}\release\rodbus_ffi.dll .\ffi-modules\${{ matrix.target }}
37
35
- name : Upload FFI modules
@@ -59,23 +57,21 @@ jobs:
59
57
runs-on : ubuntu-latest
60
58
steps :
61
59
- name : Checkout Rodbus
62
- uses : actions/checkout@v3
60
+ uses : actions/checkout@v4
63
61
with :
64
62
repository : stepfunc/rodbus
65
- ref : 1.3.1
63
+ ref : 1.4.0
66
64
- name : Install Rust
67
- uses : actions-rs/ toolchain@v1
65
+ uses : dtolnay/rust- toolchain@stable
68
66
with :
69
- profile : minimal
70
67
toolchain : stable
71
- target : ${{ matrix.target }}
72
- override : true
68
+ targets : ${{ matrix.target }}
73
69
- name : Install Rust Cross
74
70
run : cargo install cross
75
71
- name : Create FFI modules dir
76
72
run : mkdir -p ffi-modules/${{ matrix.target }}
77
73
- name : Build FFI
78
- run : cross build --release -p rodbus-ffi --no-default-features --features tls --target ${{ matrix.target }} --message-format json > ffi-modules/${{ matrix.target }}/build.log
74
+ run : cross build --release -p rodbus-ffi --no-default-features --features tls --target ${{ matrix.target }}
79
75
- name : Copy .so
80
76
run : cp ./target/${{ matrix.target }}/release/librodbus_ffi.so ./ffi-modules/${{ matrix.target }}
81
77
- name : Upload compiled FFI modules
@@ -89,42 +85,39 @@ jobs:
89
85
runs-on : ubuntu-latest
90
86
steps :
91
87
- name : Install Rust
92
- uses : actions-rs/ toolchain@v1
88
+ uses : dtolnay/rust- toolchain@stable
93
89
with :
94
- profile : minimal
95
90
toolchain : stable
96
- override : true
97
- - name : Checkout BOM tools repo
98
- uses : actions/checkout@v3
99
- with :
100
- repository : stepfunc/bom-tools
101
- ref : 0.1.0
102
- path : bom-tools
103
- - name : Install BOM tools
104
- working-directory : bom-tools
105
- run : cargo install --path bom-tools
91
+ - name : Install Cargo CycloneDx
92
+ run : cargo install cargo-cyclonedx
93
+ - name : Install custom allow-list tool
94
+ run : cargo install --git https://github.com/stepfunc/bom-tools.git
106
95
- name : Checkout Rodbus
107
- uses : actions/checkout@v3
96
+ uses : actions/checkout@v4
108
97
with :
109
98
repository : stepfunc/rodbus
110
- ref : 1.3.1
99
+ ref : 1.4.0
111
100
- name : Download compiled FFI
112
101
uses : actions/download-artifact@v2
113
102
with :
114
103
name : ffi-modules
115
104
path : ffi-modules
116
- - name : Create FFI third-party-licenses.txt
117
- run : bom-tools gen-licenses-dir ./ffi-modules build.log ./dep_config.json > third-party-licenses.txt
105
+ - name : Create SBOMs
106
+ run : |
107
+ for dir in ffi-modules/*; do
108
+ target=`basename "${dir}"`
109
+ cargo cyclonedx -f json --no-default-features --features tls --target $target
110
+ mv ./ffi/rodbus-ffi/rodbus-ffi.cdx.json ffi-modules/$target
111
+ done
112
+ - name : Create third-party-licenses.txt
113
+ run : allow-list gen-licenses-dir -l ffi-modules -b rodbus-ffi.cdx.json -c allowed.json > third-party-licenses.txt
118
114
- name : Upload third-party-licenses.txt
119
115
uses : actions/upload-artifact@v3
120
116
with :
121
117
name : third-party-licenses
122
118
path : third-party-licenses.txt
123
119
- name : Package .NET bindings
124
- uses : actions-rs/cargo@v1
125
- with :
126
- command : run
127
- args : --bin rodbus-bindings -- --dotnet --package ./ffi-modules -o ./packaging.json -f third-party-licenses.txt
120
+ run : cargo run --bin rodbus-bindings -- --dotnet --package ./ffi-modules -o ./packaging.json -f third-party-licenses.txt
128
121
- name : Upload .NET bindings
129
122
uses : actions/upload-artifact@v3
130
123
with :
0 commit comments