It's well known for smooth curves that if $\pi:X\to Y$ is a finite map, $K_X=\pi^*K_Y+Ram(\pi)$, this is just the Riemann-Hurwitz formula at the level of line bundles. I've been told that this formula is true for a finite morphism of smooth varieties over $\mathbb{C}$, at least.

First, is the above true?

Second, how must the formula be corrected if $X$ and $Y$ are both smooth orbifolds/DM-stacks?

In particular, what if I want to use that $X$ and $Y$ are of the forms $\tilde{X}/G$ and $\tilde{Y}/H$ for groups $G,H$, and express the formula in terms of objects on $\tilde{X},\tilde{Y}$?