mirror of
https://github.com/matrix-org/synapse-s3-storage-provider.git
synced 2024-10-22 23:19:42 +00:00
Make the release action upload to real PyPI (#70)
* Run `build` and `twine check` in regular CI Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
This commit is contained in:
parent
acd45b4aec
commit
f821cff55e
4 changed files with 31 additions and 11 deletions
24
.github/workflows/ci.yml
vendored
24
.github/workflows/ci.yml
vendored
|
@ -30,6 +30,29 @@ jobs:
|
|||
- name: "Run tox lint targets for ${{ matrix.python-version }}"
|
||||
run: "python -m tox -e check_isort,pep8,packaging"
|
||||
|
||||
build:
|
||||
# This is similar to the job in `release.yml`, but it does NOT upload to PyPI.
|
||||
# We include it here to reduce the likelihood of someone publishing a release
|
||||
# which doesn't build.
|
||||
name: "Build and check Python package"
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v2"
|
||||
|
||||
- uses: "actions/setup-python@v2"
|
||||
with:
|
||||
python-version: "3.6"
|
||||
|
||||
- name: "Install packaging tools"
|
||||
run: "python -m pip install --upgrade build twine"
|
||||
|
||||
- name: "Build dist package"
|
||||
run: "python -m build"
|
||||
|
||||
- name: "Run twine checks"
|
||||
run: "python -m twine check dist/*"
|
||||
|
||||
|
||||
tests:
|
||||
needs: lint
|
||||
name: "Python ${{ matrix.python-version }}"
|
||||
|
@ -55,3 +78,4 @@ jobs:
|
|||
python -m pip install --upgrade tox
|
||||
- name: "Run tox targets for ${{ matrix.python-version }}"
|
||||
run: "python -m tox -e py"
|
||||
|
||||
|
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
@ -20,7 +20,7 @@ jobs:
|
|||
run: "python -m build"
|
||||
|
||||
- name: "Upload to PyPI"
|
||||
run: "python -m twine upload --repository testpypi dist/*"
|
||||
run: "python -m twine upload dist/*"
|
||||
env:
|
||||
TWINE_USERNAME: "__token__"
|
||||
TWINE_PASSWORD: "${{ secrets.TESTPYPI_API_TOKEN }}"
|
||||
TWINE_PASSWORD: "${{ secrets.PYPI_API_TOKEN }}"
|
12
README.md
12
README.md
|
@ -77,16 +77,12 @@ Updated 0 as deleted
|
|||
# prepare to wait a long time
|
||||
```
|
||||
|
||||
Packaging
|
||||
Packaging and release
|
||||
---------
|
||||
|
||||
For maintainers:
|
||||
|
||||
1. Update the `__version__` in setup.py.
|
||||
2. Build, check and upload to PyPI as follows:
|
||||
1. Update the `__version__` in setup.py. Commit. Push.
|
||||
2. Create a release on GitHub for this version.
|
||||
3. When published, a [GitHub action workflow](https://github.com/matrix-org/synapse-s3-storage-provider/actions/workflows/release.yml) will build the package and upload to [PyPI](https://pypi.org/project/synapse-s3-storage-provider/).
|
||||
|
||||
```shell
|
||||
python -m build
|
||||
twine check dist/*
|
||||
twine upload dist/*
|
||||
```
|
||||
|
|
2
setup.py
2
setup.py
|
@ -1,6 +1,6 @@
|
|||
from setuptools import setup
|
||||
|
||||
__version__ = "1.1.1-test"
|
||||
__version__ = "1.1" # Bump to a 3-part semver for next version, i.e. 1.1.1
|
||||
|
||||
with open("README.md") as f:
|
||||
long_description = f.read()
|
||||
|
|
Loading…
Reference in a new issue