We associate to a compact spin manifold M a real-valued invariant \tau(M) by taking the supremum over all conformal classes over the infimum inside each conformal class of the first positive Dirac eigenvalue, normalized to volume 1. This invariant is a spinorial analogue of Schoen's σ-constant, also known as the smooth Yamabe number. We prove that if N is obtained from M by surgery of codimension at least 2, then τ(N)≥min{τ(M),Λn} with Λn>0. Various topological conclusions can be drawn, in particular that \tau is a spin-bordism invariant below Λn. Below Λn, the values of τ cannot accumulate from above when varied over all manifolds of a fixed dimension.