Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
31 changes: 5 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 36 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<img src="demos/demo.gif" alt="celsius demo" width="100%">
Expand Down
2 changes: 1 addition & 1 deletion tests/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down