The y-coordinate of the centroid of a (unit) semicircle (upper half) can be defined by the equation
$$\frac{1}{l(s)}\int y \space ds$$
where $\frac{1}{l(s)}=\frac{1}{\frac{\pi}{2}}=\frac{2}{\pi}$, $l(x)=\int_{-1}^{1}\sqrt{1-x^2}dx$ being the curve length of the unit semicircle (parametrisation $\gamma:[-1,1]\rightarrow \mathbb{R},\space \gamma(x)=(x,\sqrt{1-x^2})$, upper half).
I think $\int y \space ds=\int_{-1}^{1} y \space ds = \int_{-1}^{1} y \space ||\gamma'(x)||dx=\int_{-1}^{1} y \space \sqrt{(\gamma_x')^2+(\gamma_y')^2}dx= \int_{-1}^{1} \sqrt{1-x^2}\sqrt{1-\frac{x^2}{1-x^2}}dx = 2$, but the centroid should be $\frac{4\pi}{3} ≠ 2\frac{2}{\pi}$
For a semicircular area of unit radius we have $$ \iint y\,dxdy=\int_{-1}^1 dx\int_0^{\sqrt{1-x^2}}y\,dy={1\over2}\int_{-1}^1(1-x^2) dx={2\over3}. $$ To get the $y$-coordinate of the centroid we must divide that by the area of the half-circle, which is just $\pi/2$, so that: $y_C=4/(3\pi)$
If, on the other hand, one is interested in finding the centroid of a semicircular arc of unit radius, then we must integrate over the line, taking into account that for our half-circle we have $ds=dx/y$: $$ \int y\,ds=\int_{-1}^1 y {dx\over y}=\int_{-1}^1 dx=2. $$ To get the $y$-coordinate of the centroid we must divide that by the length of the semicircular arc, which is just $\pi$, so that: $y_C=2/\pi$.