  In this paper, we present in-depth analysis of the condensation energy $E_c$
for a superconductor in a situation when superconductivity emerges out of a
non-Fermi liquid due to pairing mediated by a massless boson. This is the case
for electronic-mediated pairing near a quantum-critical point in a metal, for
pairing in SYK-type models, and for phonon-mediated pairing in the properly
defined limit, when the dressed Debye frequency vanishes. We consider a subset
of these quantum-critical models, in which the pairing in a channel with a
proper spatial symmetry is described by an effective $0+1$ dimensional model
with the effective dynamical interaction $V(\Omega_m) = {\bar
g}^\gamma/|\Omega_m|^\gamma$, where $\gamma$ is model-specific (the
$\gamma$-model). In previous papers, we argued that the pairing in the $\gamma$
model is qualitatively different from that in a Fermi liquid, and the gap
equation at $T=0$ has an infinite number of topologically distinct solutions,
$\Delta_n (\omega_m)$, where an integer $n$, running between $0$ and infinity,
is the number of zeros of $\Delta_n (\omega_m)$ on the positive Matsubara axis.
This gives rise to the set of extrema of $E_c$ at $E_{c,n}$, of which $E_{c,0}$
is the global minimum. The spectrum $E_{c,n}$ is discrete for a generic $\gamma
<2$, but becomes continuous at $\gamma = 2-0$. Here, we discuss in more detail
the profile of the condensation energy near each $E_{c,n}$ and the
transformation from a discrete to a continuous spectrum at $\gamma \to 2$. We
also discuss the free energy and the specific heat of the $\gamma$-model in the
normal state.
