diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c7e504b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: release + +on: [release] + +jobs: + publish: + name: publish to pyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - run: pip install -r dev-requirements.txt + - run: python setup.py sdist bdist_wheel + - run: twine upload dist/* + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} diff --git a/README.md b/README.md index 09d0599..1d0a573 100644 --- a/README.md +++ b/README.md @@ -153,32 +153,10 @@ $ python -m unittest ## releases -**make sure the version number in `dphon/__init__.py` is correct!** - -if there are any built files in `dist/` from older releases, remove them before -you start this process: - -```sh -$ rm dist/* -``` - -to build a source archive and distribution for a release: - -```sh -$ python setup.py sdist bdist_wheel -``` - -to publish the release on [test PyPI](https://test.pypi.org/) (useful for making sure everything worked): - -```sh -$ twine upload --repository-url https://test.pypi.org/legacy/ dist/* -``` +the package is built and published to pyPI automatically using `twine` when using GitHub's release functionality. -if everything is OK, publish the package to PyPI: +**make sure the version number in `dphon/__init__.py` is correct!** -```sh -$ twine upload dist/* -```