|
1 | 1 | name: Publish |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
6 | 7 |
|
7 | 8 | jobs: |
| 9 | + release: |
| 10 | + name: Create Release |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v2 |
| 15 | + - name: Create Release |
| 16 | + id: create_release |
| 17 | + uses: actions/create-release@v1 |
| 18 | + env: |
| 19 | + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
| 20 | + with: |
| 21 | + tag_name: ${{ github.ref }} |
| 22 | + release_name: Release ${{ github.ref }} |
| 23 | + draft: false |
| 24 | + prerelease: false |
8 | 25 | deploy: |
9 | 26 | name: Deploy |
| 27 | + needs: release |
10 | 28 | runs-on: ubuntu-latest |
11 | 29 | steps: |
12 | | - - name: Setup Python 3.8 |
13 | | - uses: actions/setup-python@v2 |
14 | | - with: |
15 | | - python-version: 3.8 |
16 | | - - name: Install dependencies |
17 | | - run: | |
18 | | - python3 -m pip install -U wheel twine |
19 | | - - name: Build package |
20 | | - run: | |
21 | | - python3 setup.py sdist bdist_wheel |
22 | | - - name: Publish package to PyPI |
23 | | - run: | |
24 | | - python3 -m twine check dist/* |
25 | | - python3 -m twine upload dist/* |
26 | | - env: |
27 | | - TWINE_USERNAME: __token__ |
28 | | - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + - name: Setup Python 3.8 |
| 32 | + uses: actions/setup-python@v2 |
| 33 | + with: |
| 34 | + python-version: 3.8 |
| 35 | + - name: Install dependencies |
| 36 | + run: | |
| 37 | + python3 -m pip install -r requirements-dev.txt |
| 38 | + python3 -m pip install -U wheel twine |
| 39 | + - name: Build package |
| 40 | + run: | |
| 41 | + python3 setup.py sdist bdist_wheel |
| 42 | + - name: Publish package to PyPI |
| 43 | + run: | |
| 44 | + python3 -m twine check dist/* |
| 45 | + python3 -m twine upload dist/* |
| 46 | + env: |
| 47 | + TWINE_USERNAME: __token__ |
| 48 | + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
0 commit comments