In this work we present an automatic, deterministic procedure to fully design a metasurface antenna, self-consistently including the metallic feeding structure. The impedance pattern has full spatial variability in two dimensions, to allow designs otherwise difficult. The design is based on the integral-equation formulation with a current-only approach, in which the surface impedance profile is derived only after the optimal current is found; this allows to avoid the solution of the forward problem at all steps of the algorithm, with a drastic reduction of computational resources; it does not require any assumption on the impedance profile. We also show how a 3D feed can be accounted for in a hybrid scheme partially employing commercial 3D simulation software. Application examples address centerfed circular metasurface antennas, in which the feed is not connected to the metasurface, and rectangular "strip-like" leakywave antennas where the metasurface is electrically connected to the feeding surface. In all cases, the design is carried out up to the final layout, and the full antenna is simulated to verify the design.