diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..3c262b52 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,65 @@ +name: Publish ipie +on: + release: + types: + - publised + workflow_dispatch: + +jobs: + release-ubuntu: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v3 + - name: Setup Python # Set Python version + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy cython wheel + - name: Build wheels + run: | + python3 setup.py bdist_wheel + - name: List available wheels + run: | + ls ${{ github.workspace }}/dist + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: ${{ github.workspace }}/dist + verbose: true + + release-macos: + runs-on: macos-latest + strategy: + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy cython wheel + - name: Build wheels + run: | + python setup.py bdist_wheel -v --dist-dir ${{ github.workspace }}/mac-dist + - name: List available wheels + run: | + ls ${{ github.workspace }}/mac-dist + - name: Publish to PyPI + # pypi-publish has issues with macos + run: | + pip install twine + export TWINE_USERNAME=__token__ + export TWINE_PASSWORD="${{ secrets.PYPI_API_TOKEN }}" + twine upload --verbose ${{ github.workspace }}/mac-dist/*