|
| 1 | +name: Test Upload Python Package |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch |
| 5 | + |
| 6 | +jobs: |
| 7 | + deploy: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + with: |
| 12 | + python-version: '3.7' |
| 13 | + - name: Setup Python |
| 14 | + |
| 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 virtualenv pip-tools |
| 21 | + sudo add-apt-repository -y ppa:ubuntugis/ppa \ |
| 22 | + && sudo apt install -y \ |
| 23 | + gdal-bin libgdal-dev |
| 24 | +
|
| 25 | + mv 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 | +
|
| 31 | + cd ai-python |
| 32 | +
|
| 33 | + requirements=$(find . -type f -name "*requirements*" | paste -sd " ") |
| 34 | +
|
| 35 | + for req in $requirements |
| 36 | + do |
| 37 | + mv $req temp.in |
| 38 | + echo "-c ../requirements.txt" >> temp.in |
| 39 | + touch $req |
| 40 | + pip-compile temp.in -o $req |
| 41 | + done |
| 42 | +
|
| 43 | + cd .. |
| 44 | +
|
| 45 | + python setup.py sdist bdist_wheel |
| 46 | + - name: Publish package |
| 47 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 48 | + with: |
| 49 | + user: __token__ |
| 50 | + password: ${{ secrets.TEST_PYPI_PASSWORD }} |
| 51 | + repository_url: https://test.pypi.org/legacy/ |
| 52 | + - name: Install dependencies |
| 53 | + run: | |
| 54 | + python3.7 -m pip install --upgrade pip |
| 55 | + python3.7 -m pip install virtualenv pip-tools |
| 56 | + pip-compile --extra-index-url https://test.pypi.org/simple |
| 57 | + ai-python-package[tests] |
0 commit comments