The mean skin-friction drag in a wall-bounded turbulent flow can be decomposed into different physics-informed contributions based on the mean and statistical turbulence quantities across the wall layer. Following Renard & Deck’s study (J. Fluid Mech., vol. 790, 2016, pp. 339–367) on the skin-friction drag decomposition of incompressible wall-bounded turbulence, we extend their method to a compressible form and use it to investigate the effect of density and viscosity variations on skin-friction drag generation, using direct numerical simulation data of compressible turbulent channel flows. We use this novel decomposition to study the skin-friction contributions associated with the molecular viscous dissipation and the turbulent kinetic energy production and we investigate their dependence on Reynolds and Mach number. We show that, upon application of the compressibility transformation of Trettel & Larsson (Phys. Fluids, vol. 28, 2016, 026102), the skin-friction drag contributions can be only partially transformed into the equivalent incompressible ones, as additional terms appear representing deviations from the incompressible counterpart. Nevertheless, these additional contributions are found to be negligible at sufficiently large equivalent Reynolds number and low Mach number. Moreover, we derive an exact relationship between the wall heat flux coefficient and the skin-friction drag coefficient, which allows us to relate the wall heat flux to the skin-friction generation process.