|
| 1 | +name: Test Upload Python Package |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: [prereleased] |
| 5 | + |
| 6 | +jobs: |
| 7 | + deploy-linux: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v1 |
| 11 | + - name: Set up Python |
| 12 | + uses: actions/setup-python@v1 |
| 13 | + with: |
| 14 | + python-version: 3.6 |
| 15 | + - name: Build linux wheels |
| 16 | + run: | |
| 17 | + pip install twine |
| 18 | + docker run -v $PWD:/io quay.io/pypa/manylinux1_x86_64 "/io/build_wheels.sh" |
| 19 | + - name: Test linux wheel |
| 20 | + run: | |
| 21 | + pip install dist/finalfusion*36*.whl pytest |
| 22 | + pytest |
| 23 | + - name: Upload linux wheels |
| 24 | + env: |
| 25 | + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} |
| 26 | + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} |
| 27 | + run: | |
| 28 | + twine upload wheelhouse/*.whl --skip-existing --repository testpypi |
| 29 | + twine upload dist/*.tar.gz --repository testpypi --skip-existing |
| 30 | + deploy-mac: |
| 31 | + runs-on: macOS-latest |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + python-version: [3.6, 3.7, 3.8] |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v1 |
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v1 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python-version }} |
| 41 | + - name: Build mac wheel |
| 42 | + run: | |
| 43 | + python -m pip install --upgrade pip |
| 44 | + pip install setuptools wheel==0.31.1 twine cython |
| 45 | + python setup.py bdist_wheel |
| 46 | + - name: Test mac wheel |
| 47 | + run: | |
| 48 | + pip install dist/*.whl pytest |
| 49 | + pytest |
| 50 | + - name: Test mac wheel system python |
| 51 | + if: ${{ matrix.python-version == '3.7' }} |
| 52 | + run: | |
| 53 | + /usr/bin/python3 -m venv venv |
| 54 | + source venv/bin/activate |
| 55 | + pip install dist/*.whl pytest |
| 56 | + pytest |
| 57 | + - name: Publish macos |
| 58 | + env: |
| 59 | + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} |
| 60 | + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} |
| 61 | + run: | |
| 62 | + twine upload dist/*.whl --repository testpypi --skip-existing |
| 63 | + deploy-windows: |
| 64 | + runs-on: windows-latest |
| 65 | + strategy: |
| 66 | + matrix: |
| 67 | + python-version: [3.6, 3.7, 3.8] |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v1 |
| 70 | + - name: Set up Python |
| 71 | + uses: actions/setup-python@v1 |
| 72 | + with: |
| 73 | + python-version: ${{ matrix.python-version }} |
| 74 | + - name: Build windows wheel |
| 75 | + run: | |
| 76 | + python -m pip install --upgrade pip |
| 77 | + pip install setuptools wheel==0.31.1 twine cython |
| 78 | + python setup.py bdist_wheel |
| 79 | + - name: Publish windows |
| 80 | + env: |
| 81 | + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} |
| 82 | + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} |
| 83 | + run: | |
| 84 | + twine upload dist\*.whl --repository testpypi --skip-existing |
0 commit comments