1414 build-n-publish :
1515 runs-on : ubuntu-latest
1616 outputs :
17- wheel : ${{ steps.find-wheel.outputs.osparc-wheel-path }}
18- dist-dir : ${{ steps.find-wheel.outputs.osparc-auto- wheel-dir }}
17+ osparc : ${{ steps.find-wheel.outputs.osparc-wheel }}
18+ osparc_client : ${{ steps.find-wheel.outputs.osparc_client- wheel }}
1919 steps :
2020 - uses : actions/checkout@v3
2121 with :
@@ -35,34 +35,16 @@ jobs:
3535 - name : Determine wheel artifact
3636 id : find-wheel
3737 run : |
38- OSPARC_WHEEL=$(ls clients/python/artifacts/dist/osparc-*.whl)
39- OSPARC_AUTO_GENERATED_WHEEL=$(ls clients/python/artifacts/dist/osparc_client*.whl)
40- echo "osparc-wheel-path=${OSPARC_WHEEL}" >> $GITHUB_OUTPUT
41- echo "osparc-wheel-dir=$(dirname ${OSPARC_WHEEL})" >> $GITHUB_OUTPUT
42- echo "osparc-wheel-name=$(basename ${OSPARC_WHEEL})" >> $GITHUB_OUTPUT
43- echo "osparc-auto-wheel-path=${OSPARC_AUTO_GENERATED_WHEEL}" >> $GITHUB_OUTPUT
44- echo "osparc-auto-wheel-dir=$(dirname ${OSPARC_AUTO_GENERATED_WHEEL})" >> $GITHUB_OUTPUT
45- echo "osparc-auto-wheel-name=$(basename ${OSPARC_AUTO_GENERATED_WHEEL})" >> $GITHUB_OUTPUT
38+ cd clients/python/artifacts/dist
39+ OSPARC_WHEEL=$(ls osparc-*.whl)
40+ OSPARC_CLIENT_WHEEL=$(ls osparc_client*.whl)
41+ echo "osparc-wheel=${OSPARC_WHEEL}" >> $GITHUB_OUTPUT
42+ echo "osparc_client-wheel=${OSPARC_CLIENT_WHEEL}" >> $GITHUB_OUTPUT
4643 - name : Upload wheels
4744 uses : actions/upload-artifact@v3
4845 with :
4946 name : osparc_python_wheels
5047 path : clients/python/artifacts/dist/
51- - name : Publish package to Test PyPI
52- uses : pypa/gh-action-pypi-publish@release/v1
53- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
54- with :
55- password : ${{ secrets.TEST_PYPI_TOKEN }}
56- repository-url : https://test.pypi.org/legacy/
57- verbose : true
58- packages-dir : ${{ steps.find-wheel.outputs.wheel-dir }}
59- - name : Publish package to PyPI
60- uses : pypa/gh-action-pypi-publish@release/v1
61- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
62- with :
63- password : ${{ secrets.PYPI_TOKEN }}
64- verbose : true
65- packages-dir : ${{ steps.find-wheel.outputs.wheel-dir }}
6648
6749 test-20-04 :
6850 name : python ${{ matrix.python-version }} ubuntu-20.04
@@ -87,17 +69,17 @@ jobs:
8769 key : ${{ runner.os }}-pip-{{ matrix.python-version }}
8870 restore-keys : |
8971 ${{ runner.os }}-pip
90- - name : Donwload client
72+ - name : Download wheels
9173 uses : actions/download-artifact@v3
9274 with :
9375 name : osparc_python_wheels
9476 path : clients/python/artifacts/dist/
9577 - name : Install and Test
9678 run : |
97- make devenv
79+ python -m venv .venv
9880 source .venv/bin/activate
9981 python -m pip install pytest
100- python -m pip install ${{needs.build-n-publish.outputs.wheel }} --find-links=${{needs.build-n-publish.outputs. dist-dir}}
82+ python -m pip install clients/python/artifacts/dist/ ${{needs.build-n-publish.outputs.osparc }} --find-links=clients/python/artifacts/ dist
10183 cd clients/python
10284 make install-test
10385 pytest -v --ignore=/artifacts/client --ignore=test/e2e
@@ -123,17 +105,81 @@ jobs:
123105 key : ${{ runner.os }}-pip-{{ matrix.python-version }}
124106 restore-keys : |
125107 ${{ runner.os }}-pip
126- - name : Donwload client
108+ - name : Download wheels
127109 uses : actions/download-artifact@v3
128110 with :
129111 name : osparc_python_wheels
130112 path : clients/python/artifacts/dist/
131113 - name : Install and Test
132114 run : |
133- make devenv
115+ python -m venv .venv
134116 source .venv/bin/activate
135117 python -m pip install pytest
136- python -m pip install ${{needs.build-n-publish.outputs.wheel }} --find-links=${{needs.build-n-publish.outputs. dist-dir}}
118+ python -m pip install clients/python/artifacts/dist/ ${{needs.build-n-publish.outputs.osparc }} --find-links=clients/python/artifacts/ dist
137119 cd clients/python
138120 make install-test
139121 pytest -v --ignore=/artifacts/client --ignore=test/e2e
122+
123+ publish-osparc_client-to-pypi :
124+ name : Publish osparc_client wheel
125+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
126+ runs-on : ubuntu-latest
127+ needs : [build-n-publish, test-20-04, test-latest]
128+ environment :
129+ name : pypi
130+ url : https://pypi.org/p/osparc_client
131+ permissions :
132+ id-token : write # IMPORTANT: mandatory for trusted publishing
133+ steps :
134+ - name : Download wheels
135+ uses : actions/download-artifact@v3
136+ with :
137+ name : osparc_python_wheels
138+ path : dist/
139+ - name : Remove osparc wheel
140+ run : rm -f dist/${{needs.build-n-publish.outputs.osparc}}
141+ - name : Publish osparc_client to Test PyPI
142+ uses : pypa/gh-action-pypi-publish@release/v1
143+ with :
144+ password : ${{ secrets.TEST_PYPI_TOKEN }}
145+ repository-url : https://test.pypi.org/legacy/
146+ verbose : true
147+ packages-dir : dist/
148+ - name : Publish osparc_client to PyPI
149+ uses : pypa/gh-action-pypi-publish@release/v1
150+ with :
151+ password : ${{ secrets.PYPI_TOKEN }}
152+ verbose : true
153+ packages-dir : dist/
154+
155+ publish-osparc-to-pypi :
156+ name : Publish osparc wheel
157+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
158+ runs-on : ubuntu-latest
159+ needs : [build-n-publish, test-20-04, test-latest]
160+ environment :
161+ name : pypi
162+ url : https://pypi.org/p/osparc
163+ permissions :
164+ id-token : write # IMPORTANT: mandatory for trusted publishing
165+ steps :
166+ - name : Download wheels
167+ uses : actions/download-artifact@v3
168+ with :
169+ name : osparc_python_wheels
170+ path : dist/
171+ - name : Remove osparc_client wheel
172+ run : rm -f dist/${{needs.build-n-publish.outputs.osparc_client}}
173+ - name : Publish osparc to Test PyPI
174+ uses : pypa/gh-action-pypi-publish@release/v1
175+ with :
176+ password : ${{ secrets.TEST_PYPI_TOKEN }}
177+ repository-url : https://test.pypi.org/legacy/
178+ verbose : true
179+ packages-dir : dist/
180+ - name : Publish osparc to PyPI
181+ uses : pypa/gh-action-pypi-publish@release/v1
182+ with :
183+ password : ${{ secrets.PYPI_TOKEN }}
184+ verbose : true
185+ packages-dir : dist/
0 commit comments