shssoichiro / oxipng

Multithreaded PNG optimizer written in Rust
MIT License
2.95k stars 125 forks source link

Create deb archives on deploy #605

Closed andrews05 closed 7 months ago

andrews05 commented 7 months ago

This PR adds a step to build deb archives using cargo-deb in the deploy workflow, along with some setup steps copied from the oxipng.yml workflow. This deploys two extra release packages: oxipng_9.0.0-1_amd64.deb and oxipng_9.0.0-1_arm64.deb. (These are just the default output names produced by cargo-deb, we can change it if we need). These are only done for the gnu targets, not the musl ones. I'm not really sure what's best practice here but I figured gnu was safest. Disclaimer: I'm not an expert in GitHub workflows. Please review carefully 🙂

andrews05 commented 7 months ago

I've just pushed an extra commit that it seems I omitted earlier. It removes the rust install and just creates the deb archives using the existing binary. Note stripping is disabled since it can't do that for arm but the existing binaries don't contain any debug info anyway.

Also, it's customary for Debian packages containing native code to link against glibc, as long as they declare such dependency in their metadata. This is more space-efficient since multiple packages can share the same upgradeable C library. In my experience, cargo deb handles generating the correct dependency declarations for glibc just fine.

Yeah, I found the AArch64 steps were only required in order for it to work out the dependencies. Hopefully arm runners will be publicly available soon and we can simplify the workflows.