Eh, the Gloom Rogue archer. I'm playing this myself, but for him then -
It's 8/4 for me. A single class rogue doesn't get the APR, but doesn't need it either; only one Sneak Attack anyway. If it's going to benefit from dipping in Gloom, I'd rather take feats/ASI's so levels in groups of four. If you *really* want that extra attack, go 5/7, but you miss out on feat/ASI at 12. Not my choice, but you do you. Still, archers are least in need of feats - so if you can boost DEX with items properly, this might actually be the way to go.
So what I'd then do is;
Rogue 2, expertise in Stealth
Rogue 3 Assassin for crit guarantee
rogue 4, pick Sharpshooter
Ranger needs 3 levels to get Umbral Sight which is the best thing the Gloomie gets for this build. You will save your bonus action for hiding now; provided you're in the dark, so you don;t need the extra bonus action from thief at all, and since you only attack with your main hand..
Fourth level for Sharpshooter, you have the spellcasting from ranger that you want now. Hunter's mark is all you need.
Back to thief until 12. I'd say pick ASI from this point onward, but chances are you can boost your enough DEX enough with items. We'll have to see.
Having said all this. Astarion comes with a unique melee ability, which probably scales as you level him, do his quests and such. You are probably better off building Astarion melee focused. In that case, four levels of Battlemaster might help; but even then I'd stick to rogue for the expertise and just take that feat that grants battlemaster maneuvers.