-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
name: Publish PyPI and TestPyPI | ||
name: Publish on PyPI | ||
|
||
on: push | ||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
|
||
jobs: | ||
build-linux: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
max-parallel: 5 | ||
if: github.repository == 'aiida-phonopy/aiida-phonopy' && startsWith(github.ref, 'refs/tags/v') | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Make sdist and bdist_wheel | ||
run: pip install . | ||
|
||
- name: Publish package to TestPyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/develop') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish package to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/develop') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install flit | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flit~=3.4 | ||
- name: Build and publish to TestPyPI | ||
run: | | ||
flit publish | ||
env: | ||
FLIT_USERNAME: __token__ | ||
FLIT_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Build and publish to PyPI | ||
run: | | ||
flit publish | ||
env: | ||
FLIT_USERNAME: __token__ | ||
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |