From ab03390653490dfb47b044e0739358a8d0a29e97 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 26 Jun 2024 10:42:14 -0700 Subject: [PATCH 1/5] update version and modernize the license generation --- .github/workflows/ci.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78be266..8fb84a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v3 with: repository: stepfunc/dnp3 - ref: 1.5.2 + ref: 1.6.0 - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -30,7 +30,7 @@ jobs: - name: Create FFI modules dir run: mkdir ffi-modules\${{ matrix.target }} - name: Build FFI - run: cargo build --release -p dnp3-ffi --no-default-features --features tls --target ${{ matrix.target }} --message-format json | Out-File -encoding "UTF8" .\ffi-modules\${{ matrix.target }}\build.log + run: cargo build --release -p dnp3-ffi --no-default-features --features tls --target ${{ matrix.target }} - name: Copy .dll run: cp .\target\${{ matrix.target }}\release\dnp3_ffi.dll .\ffi-modules\${{ matrix.target }} - name: Upload FFI modules @@ -61,7 +61,7 @@ jobs: uses: actions/checkout@v3 with: repository: stepfunc/dnp3 - ref: 1.5.2 + ref: 1.6.0 - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -74,7 +74,7 @@ jobs: - name: Create FFI modules dir run: mkdir -p ffi-modules/${{ matrix.target }} - name: Build FFI - run: cross build --release -p dnp3-ffi --no-default-features --features tls --target ${{ matrix.target }} --message-format json > ffi-modules/${{ matrix.target }}/build.log + run: cross build --release -p dnp3-ffi --no-default-features --features tls --target ${{ matrix.target }} - name: Copy .so run: cp ./target/${{ matrix.target }}/release/libdnp3_ffi.so ./ffi-modules/${{ matrix.target }} - name: Upload compiled FFI modules @@ -93,27 +93,29 @@ jobs: profile: minimal toolchain: stable override: true - - name: Checkout BOM tools repo - uses: actions/checkout@v3 - with: - repository: stepfunc/bom-tools - ref: 0.1.0 - path: bom-tools - - name: Install BOM tools - working-directory: bom-tools - run: cargo install --path bom-tools + - name: Install Cargo CycloneDx + run: cargo install cargo-cyclonedx + - name: Install custom allow-list tool + run: cargo install --git https://github.com/stepfunc/bom-tools.git - name: Checkout DNP3 - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: stepfunc/dnp3 - ref: 1.5.2 + ref: 1.6.0 - name: Download compiled FFI uses: actions/download-artifact@v3 with: name: ffi-modules path: ffi-modules + - name: Create SBOMs + run: | + for dir in ffi-modules/*; do + target=`basename "${dir}"` + cargo cyclonedx -f json --target $target + mv ./ffi/dnp3-ffi/dnp3-ffi.cdx.json ffi-modules/$target + done - name: Create FFI third-party-licenses.txt - run: bom-tools gen-licenses-dir ./ffi-modules build.log ./dep_config.json > third-party-licenses.txt + run: allow-list gen-licenses-dir -l ffi-modules -b dnp3-ffi.cdx.json -c allowed.json > third-party-licenses.txt - name: Upload third-party-licenses.txt uses: actions/upload-artifact@v3 with: From bafdf2be9bb85d0320f76abd7539fec716a0179f Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 26 Jun 2024 11:01:44 -0700 Subject: [PATCH 2/5] remove serial stuff from the cyclonedx generation --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fb84a1..76328ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: run: | for dir in ffi-modules/*; do target=`basename "${dir}"` - cargo cyclonedx -f json --target $target + cargo cyclonedx -f json --no-default-features --features tls --target $target mv ./ffi/dnp3-ffi/dnp3-ffi.cdx.json ffi-modules/$target done - name: Create FFI third-party-licenses.txt From 6c51f39cef90207d8f9b33cee745d6df68c8ed6e Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 26 Jun 2024 11:11:25 -0700 Subject: [PATCH 3/5] upgrade a few action versions --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76328ae..f84cdcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,12 +17,12 @@ jobs: - target: x86_64-pc-windows-msvc # 64-bit MSVC (Windows 7+) steps: - name: Checkout DNP3 - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: stepfunc/dnp3 ref: 1.6.0 - - name: Install Rust - uses: actions-rs/toolchain@v1 + - name: Install Rust ${{ matrix.rust }} + uses: dtolnay/rust-toolchain@stable with: profile: minimal toolchain: stable @@ -58,12 +58,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout DNP3 - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: stepfunc/dnp3 ref: 1.6.0 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: profile: minimal toolchain: stable @@ -88,7 +88,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: profile: minimal toolchain: stable From 22251f3b42b51d7c50755988f2edecdc30b3d0db Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 26 Jun 2024 11:23:24 -0700 Subject: [PATCH 4/5] fix arguments to the new rust toolchain action --- .github/workflows/ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f84cdcc..6a727e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,7 @@ jobs: - name: Install Rust ${{ matrix.rust }} uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: stable - override: true - name: Create FFI modules dir run: mkdir ffi-modules\${{ matrix.target }} - name: Build FFI @@ -65,10 +63,8 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: stable - target: ${{ matrix.target }} - override: true + targets: ${{ matrix.target }} - name: Install Rust Cross run: cargo install cross - name: Create FFI modules dir @@ -90,9 +86,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: stable - override: true - name: Install Cargo CycloneDx run: cargo install cargo-cyclonedx - name: Install custom allow-list tool From 7119229193e25e6cc9a2c7db185752b4ef9469d4 Mon Sep 17 00:00:00 2001 From: jadamcrain Date: Wed, 26 Jun 2024 11:26:08 -0700 Subject: [PATCH 5/5] remove deprecated action --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a727e4..0df708a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,10 +116,7 @@ jobs: name: third-party-licenses path: third-party-licenses.txt - name: Package .NET bindings - uses: actions-rs/cargo@v1 - with: - command: run - args: --bin dnp3-bindings -- --dotnet --package ./ffi-modules -o ./packaging.json -f third-party-licenses.txt + run: cargo run --bin dnp3-bindings -- --dotnet --package ./ffi-modules -o ./packaging.json -f third-party-licenses.txt - name: Upload .NET bindings uses: actions/upload-artifact@v3 with: