Improve workflow times for releasing Docker image
When releasing a new tag, we build a new Docker image through the Build + Release docker workflow. It compiles the whole project including binaries and libs which don't end up in the Docker image.
Some unnecessary binaries are: nimiq-performance-history-store, nimiq-performance-accounts-tree, nimiq-signtx, nimiq-zkp-constraints. But there are more.
The Docker image currently only needs:
-
nimiq-client -
nimiq-bls -
nimiq-address -
nimiq-rpc
Locally a fresh cargo build --release takes 5m 46s and keeps growing as the project grows and more libs and binaries are introduced.
Compiling only the necessary binaries result in faster times.
cargo build --release --bin nimiq-client takes 2m 33s.
cargo build --release --bin nimiq-bls takes 22.01s.
cargo build --release --bin nimiq-address takes 2.8s.
cargo build --release --bin nimiq-rpc takes 25.13s.
Which is around 3m 22s in total.
This strategy can applied to more workflows to reduce Action times in general.