matrix-org / rust-synapse-compress-state

A tool to compress some state in a Synapse instance's database
https://pypi.org/project/synapse-auto-compressor/
Apache License 2.0
147 stars 33 forks source link

Add a GitHub Actions workflow for automatically publishing releases to PyPI #141

Open anoadragon453 opened 7 months ago

anoadragon453 commented 7 months ago

This CI workflow was generated by running maturin generate-ci github (how handy!). But did require a bit of finagling to satisfy the dependency on OpenSSL (boo!). Specifically, I ran into https://github.com/sfackler/rust-openssl/issues/2036#issuecomment-1724324145. I also found that I needed to set the vendored feature flag on the openssl dependency in order to get building on Linux working.

To authorise to PyPI, we ended up using PyPI's Trusted Publishers feature, which the maturin publish command supports out of the box. This involved configuring this repo and workflow name in PyPI, and then removing the env: MATURIN_PYPI_TOKEN line from the generated CI config (solution referenced here).

I haven't tested this, but given that the config came from the maturin command directly, I have fairly high confidence. After this merges, I'll run the workflow manually on the v0.1.4 tag.