|
1 |
| -name: Upload Python Package |
2 |
| - |
| 1 | +name: Python CI |
3 | 2 | on:
|
| 3 | + push: |
| 4 | + branches: [ main ] |
| 5 | + pull_request: |
| 6 | + branches: [ main ] |
4 | 7 | release:
|
5 |
| - types: [created] |
| 8 | + types: [created] |
6 | 9 | workflow_dispatch:
|
7 | 10 |
|
8 | 11 | jobs:
|
9 |
| - deploy: |
| 12 | + publish: |
10 | 13 | runs-on: ubuntu-latest
|
11 | 14 | steps:
|
12 |
| - - uses: actions/checkout@v2 |
13 |
| - - name: Setup Python |
14 |
| - uses: actions/setup-python@v2.2.2 |
15 |
| - with: |
16 |
| - python-version: 3.7 |
17 |
| - - name: Install dependencies |
18 |
| - run: | |
19 |
| - python3.7 -m pip install --upgrade pip |
20 |
| - python3.7 -m pip install setuptools wheel twine |
21 |
| - python3.7 -m pip install virtualenv pip-tools |
22 |
| - sudo add-apt-repository -y ppa:ubuntugis/ppa \ |
23 |
| - && sudo apt install -y \ |
24 |
| - gdal-bin libgdal-dev |
25 |
| - mv ./.depends/requirements.txt requirements.in |
26 |
| - touch requirements.txt |
27 |
| - echo "" >> requirements.in |
28 |
| - cat requirements.linked.in >> requirements.in |
29 |
| - pip-compile -v requirements.in |
30 |
| - cd .depends |
31 |
| - requirements=$(find . -type f -name "*.requirements*" | paste -sd " ") |
32 |
| - for req in $requirements |
33 |
| - do |
34 |
| - echo "Solving for Requirements : $req" |
35 |
| - mv $req temp.in |
36 |
| - echo "-c ../requirements.txt" >> temp.in |
37 |
| - touch $req |
38 |
| - pip-compile temp.in -o $req |
39 |
| - done |
40 |
| - cd .. |
41 |
| - mv requirements.txt ./.depends/requirements.txt |
42 |
| - python setup.py sdist bdist_wheel |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + |
| 17 | + - if: ${{ github.event_name == 'release' }} |
| 18 | + name: Publish Release to PyPi |
| 19 | + uses: dciborow/pyaction@0.0.28 |
| 20 | + with: |
| 21 | + pypi_publish: true |
| 22 | + pypi_password: ${{ secrets.PYPI_PASSWORD }} |
| 23 | + |
| 24 | + - if: ${{ github.event_name == 'push' }} |
| 25 | + name: Publish RC to PyPi |
| 26 | + uses: dciborow/pyaction@0.0.28 |
| 27 | + with: |
| 28 | + pypi_publish: true |
| 29 | + pypi_password: ${{ secrets.PYPI_PASSWORD }} |
| 30 | + version_suffix: -rc${{ github.run_number }}-post${{ github.run_attempt }} |
43 | 31 |
|
44 |
| - - name: Publish package |
45 |
| - uses: pypa/gh-action-pypi-publish@release/v1 |
46 |
| - with: |
47 |
| - user: __token__ |
48 |
| - password: ${{ secrets.PYPI_PASSWORD }} |
| 32 | + - if: ${{ github.event_name == 'pull_request' }} |
| 33 | + name: Publish Snapshot to TestPyPi |
| 34 | + uses: dciborow/pyaction@0.0.28 |
| 35 | + with: |
| 36 | + pypi_publish: true |
| 37 | + pypi_password: ${{ secrets.TEST_PYPI_PASSWORD }} |
| 38 | + pypi_repo: testpypi |
| 39 | + version_suffix: -post${{ github.run_number }}-dev${{ github.run_attempt }} |
0 commit comments