From 938f0d3ad587c0383c28156bfe03a6d71fa75146 Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Thu, 21 Oct 2021 12:35:10 +0200 Subject: [PATCH] Setup test deployment for pyLife-2.0 Signed-off-by: Johannes Mueller --- .github/workflows/pypi-deploy-odbclient.yml | 75 +++++++++++++++++++++ .github/workflows/pypi-deploy-odbserver.yml | 75 +++++++++++++++++++++ .github/workflows/pypi-deploy.yml | 20 ++++-- .github/workflows/pytest.yml | 2 +- 4 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/pypi-deploy-odbclient.yml create mode 100644 .github/workflows/pypi-deploy-odbserver.yml diff --git a/.github/workflows/pypi-deploy-odbclient.yml b/.github/workflows/pypi-deploy-odbclient.yml new file mode 100644 index 00000000..d928c531 --- /dev/null +++ b/.github/workflows/pypi-deploy-odbclient.yml @@ -0,0 +1,75 @@ +name: Build odbclient and upload to PyPI + +on: + release: + type: [published] + +defaults: + run: + working-directory: tools/odbclient + +jobs: + build_wheels: + name: Build wheels + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Install setuptools + run: | + pip install -U setuptools setuptools_scm wheel + - name: Build wheels + run: | + python setup.py bdist_wheel + - uses: actions/upload-artifact@v2 + with: + path: tools/odbclient/dist/*.whl + + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Install setuptools + run: | + pip install -U setuptools setuptools_scm wheel + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: tools/odbclient/dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.upload_pypi }} + #password: ${{ secrets.test_pypi }} + #repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/pypi-deploy-odbserver.yml b/.github/workflows/pypi-deploy-odbserver.yml new file mode 100644 index 00000000..f675df69 --- /dev/null +++ b/.github/workflows/pypi-deploy-odbserver.yml @@ -0,0 +1,75 @@ +name: Build odbserver and upload to PyPI + +on: + release: + type: [published] + +defaults: + run: + working-directory: tools/odbserver + +jobs: + build_wheels: + name: Build wheels + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Install setuptools + run: | + pip install -U setuptools setuptools_scm wheel + - name: Build wheels + run: | + python setup.py bdist_wheel + - uses: actions/upload-artifact@v2 + with: + path: tools/odbserver/dist/*.whl + + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Install setuptools + run: | + pip install -U setuptools setuptools_scm wheel + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: tools/odbserver/dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.upload_pypi }} + #password: ${{ secrets.test_pypi }} + #repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/pypi-deploy.yml b/.github/workflows/pypi-deploy.yml index f9af42e0..82915c40 100644 --- a/.github/workflows/pypi-deploy.yml +++ b/.github/workflows/pypi-deploy.yml @@ -20,6 +20,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-python@v2 name: Install Python @@ -28,13 +30,15 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel + #python -m pip install cibuildwheel + pip install -U setuptools setuptools_scm wheel - name: Build wheels run: | - python -m cibuildwheel --output-dir wheelhouse + # python -m cibuildwheel --output-dir wheelhouse + python setup.py bdist_wheel - uses: actions/upload-artifact@v2 with: - path: ./wheelhouse/*.whl + path: ./dist/*.whl build_sdist: @@ -42,12 +46,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-python@v2 name: Install Python with: python-version: '3.8' + - name: Install setuptools + run: | + pip install -U setuptools setuptools_scm wheel + - name: Build sdist run: python setup.py sdist @@ -69,5 +79,5 @@ jobs: with: user: __token__ password: ${{ secrets.upload_pypi }} - # password: ${{ secrets.test_pypi }} - # repository_url: https://test.pypi.org/legacy/ + #password: ${{ secrets.test_pypi }} + #repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5ed78552..92517250 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,6 +1,6 @@ name: testsuite -on: [push, pull_request] +on: [pull_request] jobs: build: