From cbe7ac6c7a592b4879eefaf6f3abb9abe633bb00 Mon Sep 17 00:00:00 2001 From: Andreas Heger Date: Wed, 17 Nov 2021 14:53:23 +0000 Subject: [PATCH] no osx, apsw package --- .github/workflows/ci.yaml | 3 +- .github/workflows/release.yaml | 90 ++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3645f37..a37962f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,8 @@ jobs: runs-on: ${{ matrix.os }}-latest strategy: matrix: - os: [ubuntu, macos] + # apsw not available for macos + os: [ubuntu] # , macos] # apsw not available for 3.10, not installable via tar python-version: ['3.6', '3.7', '3.8', '3.9'] # , '3.10'] poetry-version: [1.1.11] diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e97d27e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,90 @@ +name: Publish cgat-daisy wheels to PyPI and TestPyPI + +on: + push: + branches: + - v[0-9]+.[0-9]+.x + tags: + - v* + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + cibw_archs: ["auto"] + + steps: + - name: Checkout cgat-daisy + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: '3.9' + + - name: Run image + uses: abatilo/actions-poetry@v2.0.0 + + - name: Poetry install + run: poetry install + + - name: Poetry install + run: poetry build --format=sdist + + - name: Build wheels for linux + if: runner.os == 'Linux' + uses: pypa/cibuildwheel@v2.2.2 + env: + CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* + CIBW_SKIP: "*musllinux*" + CIBW_ARCHS: ${{ matrix.cibw_archs }} + + # - name: Build wheels for macos + # if: runner.os != 'Linux' + # uses: pypa/cibuildwheel@v2.2.2 + # env: + # CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* + # CIBW_BEFORE_BUILD: pip install cython + # CIBW_ARCHS: ${{ matrix.cibw_archs }} + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + + upload_pypi: + + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + + steps: + - name: Get Artifacts + uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - name: Publish distribution to Test PyPI + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + # - name: Publish distribution to PyPI + # if: github.event_name == 'release' && github.event.action == 'published' + # uses: pypa/gh-action-pypi-publish@master + # with: + # password: ${{ secrets.PYPI_API_TOKEN }} +