1- name : Build and upload to PyPI
1+ name : Build and upload to PyPI
22# Build on every workflow_dispatch, branch push, tag push, and pull request change
33on :
44 workflow_dispatch :
55 pull_request :
66 push :
77 branches :
88 - master
9+ - fix_dll_error_issue
910 # Sequence of patterns matched against refs/tags
1011 tags :
1112 - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
2627 CIBW_BUILD : " *-win_amd64"
2728 CIBW_SKIP : " cp38-*"
2829
29- - uses : actions/upload-artifact@v4.4.3
30+ - name : Inject ibm_db_dll.pth into wheels
31+ run : python scripts/inject_pth_into_wheel.py wheelhouse
32+
33+ - uses : actions/upload-artifact@v4
3034 with :
3135 name : ibmdb-wheels64-${{ matrix.os }}
3236 path : wheelhouse/*.whl
4650 CIBW_BUILD : " *-win32"
4751 CIBW_SKIP : " cp38-*"
4852
49- - uses : actions/upload-artifact@v4.4.3
53+ - name : Inject ibm_db_dll.pth into wheels
54+ run : python scripts/inject_pth_into_wheel.py wheelhouse
55+
56+ - uses : actions/upload-artifact@v4
5057 with :
5158 name : ibmdb-wheels32-${{ matrix.os }}
5259 path : wheelhouse/*.whl
8188 --wheel-dir {dest_dir}
8289 {wheel}
8390
84- - uses : actions/upload-artifact@v4.4.3
91+ - uses : actions/upload-artifact@v4
8592 with :
8693 name : ibmdb-wheels-${{ matrix.os }}
8794 path : wheelhouse/*.whl
@@ -101,7 +108,7 @@ jobs:
101108 CIBW_SKIP : " cp38-*"
102109 MACOSX_DEPLOYMENT_TARGET : 14.0
103110
104- - uses : actions/upload-artifact@v4.4.3
111+ - uses : actions/upload-artifact@v4
105112 with :
106113 name : ibmdb-wheelsarm64
107114 path : wheelhouse/*.whl
@@ -122,7 +129,7 @@ jobs:
122129 CIBW_SKIP : " cp38-*"
123130 MACOSX_DEPLOYMENT_TARGET : 10.15
124131
125- - uses : actions/upload-artifact@v4.4.3
132+ - uses : actions/upload-artifact@v4
126133 with :
127134 name : ibmdb-wheelsx86-${{ matrix.os }}
128135 path : wheelhouse/*.whl
@@ -136,26 +143,19 @@ jobs:
136143 run : python -m pip install --upgrade pip build
137144 - name : Build sdist
138145 run : python -m build --sdist --no-isolation
139- - name : Package version
140- id : version
141- run : |
142- cd dist
143- pip install ibm_db*
144- echo "VERSION=$(python -c 'import ibm_db; print(ibm_db.__version__)')" >> $GITHUB_OUTPUT
145- - name : Build source distribution
146+ - name : Remove clidriver from sdist
146147 run : |
147- PACKAGE="ibm_db-$VERSION"
148148 cd dist
149- tar -xzf $PACKAGE .tar.gz
150- rm -rf $PACKAGE/clidriver*
151- rm -rf $PACKAGE.tar.gz
152- tar -czf $PACKAGE.tar.gz $PACKAGE
153- rm -rf $PACKAGE
154- env :
155- VERSION : ${{ steps.version.outputs.VERSION}}
149+ TARBALL=$(ls ibm?db-* .tar.gz | head -1)
150+ DIRNAME="${TARBALL%.tar.gz}"
151+ tar -xzf "$TARBALL"
152+ rm -rf "$DIRNAME"/clidriver*
153+ rm -rf "$TARBALL"
154+ tar -czf "$TARBALL" "$DIRNAME"
155+ rm -rf "$DIRNAME"
156156
157157 - name : Upload sdist
158- uses : actions/upload-artifact@v4.4.3
158+ uses : actions/upload-artifact@v4
159159 with :
160160 name : ibmdb-sdist
161161 path : dist/*.tar.gz
@@ -182,3 +182,24 @@ jobs:
182182 - name : Publish distribution to PyPI
183183 if : startsWith(github.ref, 'refs/tags')
184184 uses : pypa/gh-action-pypi-publish@release/v1.12
185+
186+ upload_testpypi :
187+ needs : [build_wheels_windows_64, build_wheels_windows_32, build_wheels_linux, build_wheels_macos_arm64, build_wheels_macos_x86, build_sdist]
188+ runs-on : ubuntu-latest
189+ permissions :
190+ id-token : write
191+
192+ # upload to TestPyPI on push to test_dll_issue branch
193+ if : github.event_name == 'push' && github.ref == 'refs/heads/test_dll_issue'
194+ steps :
195+ - uses : actions/download-artifact@v5
196+ with :
197+ path : dist
198+ pattern : ibmdb-*
199+ merge-multiple : true
200+
201+ - name : Publish distribution to TestPyPI
202+ uses : pypa/gh-action-pypi-publish@release/v1.12
203+ with :
204+ repository-url : https://test.pypi.org/legacy/
205+ verbose : true
0 commit comments