commit 45e30924b6242769c067f8e559f9d6b68d653e81 parent 4ef2f1b1c1c6ad488906ec3d0ffb3850fb648d55 Author: Eric Scouten <scouten@adobe.com> Date: Tue, 19 Jul 2022 13:28:31 -0700 Fix publish workflow (#82) A [recent crate publish operation failed](https://github.com/contentauth/c2pa-rs/runs/7413936641?check_suite_focus=true), so we're taking two steps to mitigate: 1. Run `cargo publish --dry-run -p c2pa` as part of PR validation loop. 2. Fix the error identified in this particular case. Diffstat:
| M | .github/workflows/ci.yml | | | 27 | +++++++++++++++++++++++++++ |
| M | sdk/src/validator.rs | | | 4 | ++-- |
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml @@ -99,6 +99,33 @@ jobs: run: wasm-pack test --chrome --headless working-directory: ./sdk + publish-preflight: + name: Preflight crate publish + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + rust_version: [stable] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust_version }} + components: llvm-tools-preview + override: true + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v1 + + - name: Dry-run of crate publish + run: cargo publish -p c2pa --dry-run + clippy_check: name: Clippy runs-on: ubuntu-latest diff --git a/sdk/src/validator.rs b/sdk/src/validator.rs @@ -70,6 +70,6 @@ pub(crate) fn get_validator(alg: SigningAlg) -> Box<dyn CoseValidator> { #[cfg(not(feature = "file_io"))] #[allow(dead_code)] -pub(crate) fn get_validator(_alg: &str) -> Option<Box<dyn CoseValidator>> { - Some(Box::new(DummyValidator)) +pub(crate) fn get_validator(_alg: SigningAlg) -> Box<dyn CoseValidator> { + Box::new(DummyValidator) }