Could something similar be used to publish an artifact to Pypi?
It probably not the cleanest way to do it, but I liked having it "spelled out" in steps manually to play around and learn more about how to do this.
You can see my workflow in the toy repo here: https://github.com/ikornaselur/img-utils/blob/master/.github...
(I did post this link in direct thread, copied here)
https://gist.github.com/tracker1/fdd5ceab8f532afc3a05ab9c0bd...
I also do a MyPy type check as well with the actions stuff. It's very similar to the GitLab CI stuff, if you have used that.