  Energy and momentum feedback from stars is a key element of models for galaxy
formation and interstellar medium dynamics, but resolving the relevant length
scales to directly include this feedback remain out of reach of
current-generation simulations. We aim to constrain the energy feedback by
winds, photoionisation and supernovae (SNe) from massive stars. We measure the
thermal and kinetic energy imparted to the interstellar medium on various
length scales, calculated from high-resolution 1D radiation-hydrodynamics
simulations. Our grid of simulations covers a broad range of densities,
metallicities, and state-of-the-art evolutionary models of single and binary
stars. We find that a single star or binary system can carve a cavity of
tens-of-pc size into the surrounding medium. During the pre-SN phase,
post-main-sequence stellar winds and photoionisation dominate. While SN
explosions dominate the total energy budget, the pre-SN feedback is of great
importance by reducing the circumstellar gas density and delaying the onset of
radiative losses in the SN remnant. Contrary to expectations, the metallicity
dependence of the stellar wind has little effect on the cumulative energy
imparted by feedback to the ISM; the only requirement is the existence of a
sufficient level of pre-SN radiative and mechanical feedback. The ambient
medium density determines how much and when feedback energy reaches to distance
$\gtrsim 10-20$ pc and affects the division between kinetic and thermal
feedback. Our results can be used as a sub-grid model for feedback in
large-scale simulations of galaxies. The results reinforce that the uncertain
mapping of stellar evolution sequences to SN explosion energy is very important
to determining the overall feedback energy from a stellar population.
