-
Notifications
You must be signed in to change notification settings - Fork 12
36 lines (35 loc) · 1.21 KB
/
publish_to_pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build and publish to TestPyPI or PyPI
on: [push, pull_request]
jobs:
build-n-publish:
name: Build package and publish to (Test)PyPI
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Build source tarballs and wheels
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m build
- name: Publish distribution 📦 to Test PyPI
if: github.ref == 'refs/heads/master' && github.repository == 'brian-team/brian2cuda'
run: |
python -m pip install twine
twine upload -r testpypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Publish distribution release 📦 to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/v') && github.repository == 'brian-team/brian2cuda' }}
run: |
python -m pip install twine
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}