[version] Bump ratarmount version to 1.0.0 #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine build | |
- name: Build and Publish | |
env: | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
run: | | |
python3 -m build | |
# Around commit 08ddc8fb3679faacd6e54eb5c54104995b045dc4, I had some very weird twine check failures | |
# because .tar.gz tarballs were wrongly recognized as ZIP files by CPython's zipfile.is_zipfile. | |
# Therefore, try recompressing the tarballs with different compression levels until it does not randomly | |
# look like a ZIP anymore. It is an ugly hack, but so is zipfile.is_zipfile. | |
tarball=$( find dist -name '*.tar.gz' ) | |
if python3 -c 'import sys, zipfile; sys.exit(0 if zipfile.is_zipfile(sys.argv[1]) else 1)' "$tarball"; then | |
gzip -c -d "$tarball" > "$tarball.tar" | |
for (( i=9; i>0; --i )); do | |
cat "$tarball.tar" | gzip -$i > "$tarball" | |
if ! python3 -c 'import sys, zipfile; sys.exit(0 if zipfile.is_zipfile(sys.argv[1]) else 1)' "$tarball" | |
then break; fi | |
done | |
fi | |
twine check dist/* | |
twine upload --skip-existing -u __token__ dist/* |