Skip to content

Commit

Permalink
Setup test deployment for pyLife-2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Mueller <johannes.mueller4@de.bosch.com>
  • Loading branch information
johannes-mueller committed Oct 22, 2021
1 parent f8adfa7 commit 938f0d3
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 6 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/pypi-deploy-odbclient.yml
Original file line number Diff line number Diff line change
@@ -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/
75 changes: 75 additions & 0 deletions .github/workflows/pypi-deploy-odbserver.yml
Original file line number Diff line number Diff line change
@@ -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/
20 changes: 15 additions & 5 deletions .github/workflows/pypi-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2
name: Install Python
Expand All @@ -28,26 +30,34 @@ 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:
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

Expand All @@ -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/
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: testsuite

on: [push, pull_request]
on: [pull_request]

jobs:
build:
Expand Down

0 comments on commit 938f0d3

Please sign in to comment.