I think this is really important. But should add that if you want to do something don't be afraid to make said post. If you feel lonely, reach out.
I moved across the country and had no friends there (into an engineering firm, in an engineering town, with few people my age (mostly engineers)). Being mostly an introvert I was fine being alone 99% of the time, but everyone needs friends. I figured out that when I need friend time that I had to be the one to organize such events. If I didn't then no one did anything, or the groups that already existed would just do their own things. (Can't blame them for excluding me. Not like it was a malicious act. Just no one knew me.) It can just be something simple as "Hey I was going to do $X on $DAY, want to come too?" (direct works better than an open invitation) After learning this I did actually develop friends and got invited to things.
So what I'm saying is that if you feel lonely you have to reach out. I completely understand that this sucks as an introvert. But you do have some control over this and you can't completely rely on others to invite you to things.
Someone who works in tech who is interested in tech and goes to tech events. I don't buy it :).
Maybe I don't enjoy sports or poker; maybe you don't enjoy sci-fi book readings or craft nights, but chances are we both want learn some new tricks (with free beer and snacks). I suppose the risk there is that it can feel like an obligation -- and I actually had a boss accuse me of networking for my next job by going to tech events.