As mentioned, anti-gravity and or gravity generators will let you pull magic out of thin air, but let's try it without magic. I can't imagine why anyone would bother doing it, but I decided to see what happens and ended up with a totally insane project that uses a lot of carbon nanotube (CNT) and crazy amounts of energy. But, you don't need unproven technologies like anti-gravity or unobtanium. $\ddot\smile$
Creating the Beast
The Schwarzschild radius of a black hole is $r_s<{2MG\over c^2}$. Solving that for mass, given a ½ ly radius, we get $M<3.19\cdot 10^{42}kg$ to avoid being a black hole.
The surface area of a sphere is $A=4\pi r^2$. The volume of spherical shell is $V\approx A\Delta r$ for $r\gg\Delta r$. The mass of the shell is $M=V\rho\approx A\Delta r\rho=4\pi r^2\Delta r\rho$. Solving that for thickness, given ½ ly radius, the mass given above, and the density of CNT (about $1.3 {g\over cm^3}$), we get $\Delta r<8727 km$.
The compressive strength of CNT is around 416 MPa. The inside of the sphere feels the pressure of the entire mass weighing down on it. The force is given by $f=Ma$, where $a$ is acceleration at the surface. $a={MG\over r^2}$, so $f={M^2G\over r^2}$. Pressure is $p={f\over A}={{M^2G\over r^2}\over 4\pi r^2}={M^2G\over 4\pi r^4}$. Rearranging gives $M=\sqrt{4p\pi r^4\over G}=r^2\sqrt{4p\pi\over G}$. Solving for mass, given 416 MPa and ½ ly radius, we get $1.98\cdot 10^{41}kg$, which is not a black hole, yay.
Using that mass, we can calculate a thickness of 55 km, surface acceleration of 0.0061 g (about $1\over 164$ Earth gravity), not a black hole, and the CNT construction can withstand the pressures. Of course, getting 10 billion solar masses of carbon nanotubes is a bit of a feat, but it's not outside the realm of just-possible.
You wouldn't be able to cover the entire thing with people, dirt, etc., and you'd need some source of energy (maybe a Dyson sphere surrounding a super-massive star in the center of your CNT planet?), but it's doable without magic.
Add some "Gravity"
As Zsolt Szilagy points out, pretty much any kind of rotation you can actually notice is going to wreak havoc with shear forces, but you might be able to spin it just fast enough to get some normal Earth gravity along the equator if you put your people on the inside. Wikipedia says the breaking length of CNT is around 4700 km under 1 g, so the CNT should stay together while being flung outward at 1 g. Centripetal acceleration is given by $a={v^2\over r}$ for uniform circular motion. Solving for speed, given 1 g and ½ ly radius, we get 0.718 c at the equator. Not impossible, but it's going to take a long time to get there.
Notes
Also, angular kinetic energy is $E={1\over 2}I\omega^2$, and $I={2\over 3}Mr^2$ for a thin, spherical shell. $\omega={v\over r}$, so $E={1\over 2}{2\over 3}Mr^2({v_\text{equator}\over r})^2={1\over 3}Mv_\text{eq}^2$. Solving for energy, given mass of $2\cdot 10^{41}kg$ and $0.718c$ speed, we get $3\cdot 10^{57}J$, which means converting about 8% of the Milky Way's mass to kinetic energy over some insanely long time period to do it.
Of note, if you're going to spin the "planet" and put people on the inside, you might as well save a bunch of material and just make it a Ringworld-style ring (it's still going to be insane though). Also, at 0.7 c, we're getting into relativistic territory, so the Newtonian equations aren't perfect, but I don't think it's anything sufficiently advanced scientists can't handle if they made it to this point. I'd be more worried about extrapolating CNT strengths from $\mu m$ scales to $km$ scales. And rogue stars.