@@ -18,20 +18,18 @@ jobs:
1818 extra-param : # nothing
1919 steps :
2020 - name : Checkout Rodbus
21- uses : actions/checkout@v3
21+ uses : actions/checkout@v4
2222 with :
2323 repository : stepfunc/rodbus
24- ref : 1.3.1
24+ ref : 1.4.0
2525 - name : Install Rust
26- uses : actions-rs/ toolchain@v1
26+ uses : dtolnay/rust- toolchain@stable
2727 with :
28- profile : minimal
2928 toolchain : stable
30- override : true
3129 - name : Create FFI modules dir
3230 run : mkdir ffi-modules\${{ matrix.target }}
3331 - 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 }}
3533 - name : Copy .dll
3634 run : cp .\target\${{ matrix.target }}\release\rodbus_ffi.dll .\ffi-modules\${{ matrix.target }}
3735 - name : Upload FFI modules
@@ -59,23 +57,21 @@ jobs:
5957 runs-on : ubuntu-latest
6058 steps :
6159 - name : Checkout Rodbus
62- uses : actions/checkout@v3
60+ uses : actions/checkout@v4
6361 with :
6462 repository : stepfunc/rodbus
65- ref : 1.3.1
63+ ref : 1.4.0
6664 - name : Install Rust
67- uses : actions-rs/ toolchain@v1
65+ uses : dtolnay/rust- toolchain@stable
6866 with :
69- profile : minimal
7067 toolchain : stable
71- target : ${{ matrix.target }}
72- override : true
68+ targets : ${{ matrix.target }}
7369 - name : Install Rust Cross
7470 run : cargo install cross
7571 - name : Create FFI modules dir
7672 run : mkdir -p ffi-modules/${{ matrix.target }}
7773 - 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 }}
7975 - name : Copy .so
8076 run : cp ./target/${{ matrix.target }}/release/librodbus_ffi.so ./ffi-modules/${{ matrix.target }}
8177 - name : Upload compiled FFI modules
@@ -89,42 +85,39 @@ jobs:
8985 runs-on : ubuntu-latest
9086 steps :
9187 - name : Install Rust
92- uses : actions-rs/ toolchain@v1
88+ uses : dtolnay/rust- toolchain@stable
9389 with :
94- profile : minimal
9590 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
10695 - name : Checkout Rodbus
107- uses : actions/checkout@v3
96+ uses : actions/checkout@v4
10897 with :
10998 repository : stepfunc/rodbus
110- ref : 1.3.1
99+ ref : 1.4.0
111100 - name : Download compiled FFI
112101 uses : actions/download-artifact@v2
113102 with :
114103 name : ffi-modules
115104 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
118114 - name : Upload third-party-licenses.txt
119115 uses : actions/upload-artifact@v3
120116 with :
121117 name : third-party-licenses
122118 path : third-party-licenses.txt
123119 - 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
128121 - name : Upload .NET bindings
129122 uses : actions/upload-artifact@v3
130123 with :
0 commit comments