Yes. The assumption implies that $\mathcal{B}$ is cofinal in the poset $[\kappa]^{<\kappa}$, and hence that this poset has cofinality $\le\kappa$. This implies that $\kappa$ is regular, [by this answer][1]. [1]: https://mathoverflow.net/a/313447/14094