diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 66a07c9..cc16106 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -51,7 +51,14 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: release-plz/action@v0.5 + id: release-pr with: command: release-pr env: GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} + + - if: steps.release-pr.outputs.prs_created == 'true' + env: + GH_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} + PR: ${{ fromJSON(steps.release-pr.outputs.pr).number }} + run: gh pr merge --auto --squash "$PR" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f76ef4..756a423 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,39 +42,18 @@ jobs: - uses: actions/attest@v4 with: subject-checksums: ${{ steps.upload.outputs.sha256 }} - - size-badge: - name: publish the binary size badge - needs: upload-binaries - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v7 - with: - ref: badges - persist-credentials: true - path: badges - - - name: measure and publish - working-directory: badges + - name: publish the binary size + if: matrix.target == 'x86_64-unknown-linux-musl' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG: ${{ github.ref_name }} + ARCHIVE: ${{ steps.upload.outputs.tar }} run: | set -euo pipefail - archive="celsius-$TAG-x86_64-unknown-linux-musl.tar.gz" - gh release download "$TAG" --repo lmarkmann/celsius -p "$archive" -D dl - tar -xzf "dl/$archive" -C dl - bytes=$(stat -c%s dl/celsius) + bytes=$(tar -xzf "$ARCHIVE" -O celsius | wc -c | tr -d ' ') mib=$(awk -v b="$bytes" 'BEGIN { printf "%.1f", b / 1048576 }') - rm -rf dl printf '{"schemaVersion":1,"label":"binary","message":"%s MB","color":"blue"}\n' "$mib" > size.json - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add size.json - git diff --cached --quiet || git commit -m "celsius $TAG: ${mib} MB" - git push + gh release upload "$TAG" size.json --clobber homebrew: name: bump homebrew formula diff --git a/Cargo.lock b/Cargo.lock index f8a5d98..26d4ca6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -147,11 +147,11 @@ checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" dependencies = [ - "generic-array", + "hybrid-array", ] [[package]] @@ -424,7 +424,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -441,6 +441,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "convert_case" version = "0.10.0" @@ -487,9 +493,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.17" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" dependencies = [ "libc", ] @@ -573,12 +579,11 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-common" -version = "0.1.7" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ - "generic-array", - "typenum", + "hybrid-array", ] [[package]] @@ -654,11 +659,12 @@ checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "digest" -version = "0.10.7" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ "block-buffer", + "const-oid", "crypto-common", ] @@ -722,7 +728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -792,16 +798,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -901,6 +897,15 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +[[package]] +name = "hybrid-array" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b" +dependencies = [ + "typenum", +] + [[package]] name = "iana-time-zone" version = "0.1.65" @@ -1102,7 +1107,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1681,7 +1686,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1797,9 +1802,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.9" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" dependencies = [ "cfg-if", "cpufeatures", @@ -1953,7 +1958,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2037,9 +2042,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicode-ident" @@ -2260,7 +2265,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1a934d6..37a2bcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,7 @@ assert_cmd = "2" criterion = { version = "5.0.1", features = ["html_reports"], package = "codspeed-criterion-compat" } predicates = "3" serde_json = "1" -sha2 = "0.10" +sha2 = "0.11" [[test]] name = "oracle" diff --git a/README.md b/README.md index f12dde0..50ec759 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Built With Ratatui](https://ratatui.rs/built-with-ratatui/badge.svg)](https://ratatui.rs/) [![Crates.io](https://img.shields.io/crates/v/celsius?logo=rust)](https://crates.io/crates/celsius) [![CI](https://github.com/lmarkmann/celsius/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/lmarkmann/celsius/actions/workflows/ci.yml?query=branch%3Amain) -[![Binary size](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/lmarkmann/celsius/badges/size.json)](https://github.com/lmarkmann/celsius/releases/latest) +[![Binary size](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Flmarkmann%2Fcelsius%2Freleases%2Flatest%2Fdownload%2Fsize.json&query=%24.message&label=binary&color=blue)](https://github.com/lmarkmann/celsius/releases/latest) [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE) celsius demo diff --git a/tests/oracle.rs b/tests/oracle.rs index 1f8c627..a3575bc 100644 --- a/tests/oracle.rs +++ b/tests/oracle.rs @@ -36,7 +36,7 @@ fn scene_path(root: &Path, name: &str) -> PathBuf { fn sha256_hex(bytes: &[u8]) -> String { let mut h = Sha256::new(); h.update(bytes); - format!("{:x}", h.finalize()) + h.finalize().iter().map(|b| format!("{b:02x}")).collect() } /// Render a scene the way the oracle does and return its scene-TOML hash, the PNG bytes, and the PNG hash. The checker and the bless writer both go through here, so a locked manifest can never disagree with what the test verifies.