What are the various steps to contribute my own module to Drupal.org? I wrote a custom javascript thing for the Views module but I'm not sure how to go about publishing this on drupal.org.

I know there are a lot of requirements, but what are the steps to be completed and where to publish (contribute) this module?

It seems daunting since I never contributed a module before.
The main pages you need to read are Best practices for creating and maintaining projects and Project application checklist.  If you have never done this before, you need to read Creating a sandbox (experimental) project

In short, you need to


Obtain git access on drupal.org
Create your sandbox project
Commit your code
Submit it for review
If approved, it will be promoted to be a full project


Keep in mind that your project will likely never be officially reviewed unless you get a review bonus.  Participating in other reviews is also a good way to learn about best practices so you can get through the initial review smoothly.