We report wall-resolved large-eddy simulation (LES) of flow over a grooved cylinder up to the transcritical regime. The stretched-vortex subgrid-scale model is embedded in a general fourth-order finite-difference code discretization on a curvilinear mesh. In the present study $32$ grooves are equally distributed around the circumference of the cylinder, each of sinusoidal shape with height $\unicode[STIX]{x1D716}$, invariant in the spanwise direction. Based on the two parameters, $\unicode[STIX]{x1D716}/D$ and the Reynolds number $Re_{D}=U_{\infty }D/\unicode[STIX]{x1D708}$ where $U_{\infty }$ is the free-stream velocity, $D$ the diameter of the cylinder and $\unicode[STIX]{x1D708}$ the kinematic viscosity, two main sets of simulations are described. The first set varies $\unicode[STIX]{x1D716}/D$ from $0$ to $1/32$ while fixing $Re_{D}=3.9\times 10^{3}$. We study the flow deviation from the smooth-cylinder case, with emphasis on several important statistics such as the length of the mean-flow recirculation bubble $L_{B}$, the pressure coefficient $C_{p}$, the skin-friction coefficient $C_{f\unicode[STIX]{x1D703}}$ and the non-dimensional pressure gradient parameter $\unicode[STIX]{x1D6FD}$. It is found that, with increasing $\unicode[STIX]{x1D716}/D$ at fixed $Re_{D}$, some properties of the mean flow behave somewhat similarly to changes in the smooth-cylinder flow when $Re_{D}$ is increased. This includes shrinking $L_{B}$ and nearly constant minimum pressure coefficient. In contrast, while the non-dimensional pressure gradient parameter $\unicode[STIX]{x1D6FD}$ remains nearly constant for the front part of the smooth cylinder flow, $\unicode[STIX]{x1D6FD}$ shows an oscillatory variation for the grooved-cylinder case. The second main set of LES varies $Re_{D}$ from $3.9\times 10^{3}$ to $6\times 10^{4}$ with fixed $\unicode[STIX]{x1D716}/D=1/32$. It is found that this $Re_{D}$ range spans the subcritical and supercritical regimes and reaches the beginning of the transcritical flow regime. Mean-flow properties are diagnosed and compared with available experimental data including $C_{p}$ and the drag coefficient $C_{D}$. The timewise variation of the lift and drag coefficients are also studied to elucidate the transition among three regimes. Instantaneous images of the surface, skin-friction vector field and also of the three-dimensional Q-criterion field are utilized to further understand the dynamics of the near-surface flow structures and vortex shedding. Comparison of the grooved-cylinder flow with the equivalent flow over a smooth-wall cylinder shows structural similarities but significant differences. Both flows exhibit a clear common signature, which is the formation of mean-flow secondary separation bubbles that transform to other local flow features upstream of the main separation region (prior separation bubbles) as $Re_{D}$ is increased through the respective drag crises. Based on these similarities it is hypothesized that the drag crises known to occur for flow past a cylinder with different surface topographies is the result of a change in the global flow state generated by an interaction of primary flow separation with secondary flow recirculating motions that manifest as a mean-flow secondary bubble. For the smooth-wall flow this is accompanied by local boundary-layer flow transition to turbulence and a strong drag crisis, while for the grooved-cylinder case the flow remains laminar but unsteady through its drag crisis and into the early transcritical flow range.