-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bld_wheels_and_upload.yml
- Loading branch information
Showing
8 changed files
with
116 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
name: Build and upload to PyPI | ||
|
||
# Build on every branch push, tag push, and pull request change: | ||
# Build on every workflow_dispatch, branch push, tag push, and pull request change | ||
on: | ||
#workflow_dispatch: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- WheelSupport | ||
- master | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build_wheels_windows_64: | ||
name: Build wheels on ${{ matrix.os }} 64-bit | ||
name: Build wheels on ${{ matrix.os }} 64-bit | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build wheels | ||
uses: pypa/[email protected].1 | ||
uses: pypa/[email protected].2 | ||
env: | ||
CIBW_SKIP: "*-win32" | ||
CIBW_SKIP: "*pp3*" | ||
CIBW_BUILD: "*-win_amd64" | ||
CIBW_SKIP: "cp36-* pp*" | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
@@ -33,9 +38,10 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build wheels | ||
uses: pypa/[email protected].1 | ||
uses: pypa/[email protected].2 | ||
env: | ||
CIBW_BUILD: "*-win32" | ||
CIBW_SKIP: "cp36-* pp*" | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
@@ -45,14 +51,13 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [macos-latest,ubuntu-latest] | ||
#os: [windows-latest, ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build wheels | ||
uses: pypa/[email protected].1 | ||
uses: pypa/[email protected].2 | ||
env: | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | ||
CIBW_SKIP: "*-musllinux_* pp*" | ||
CIBW_SKIP: "cp36-* *-musllinux_* pp* *-*linux_{aarch64,ppc64le}" | ||
CIBW_REPAIR_WHEEL_COMMAND_LINUX: | ||
auditwheel repair | ||
--exclude libdb2.so.1 | ||
|
@@ -75,40 +80,59 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip build | ||
run: python -m pip install --upgrade pip build | ||
- name: Build sdist | ||
run: python -m build --sdist --no-isolation | ||
- name: Package version | ||
id: version | ||
run: | | ||
cd dist | ||
pip install ibm_db* | ||
echo "VERSION=$(python -c 'import ibm_db; print(ibm_db.__version__)')" >> $GITHUB_OUTPUT | ||
- name: Build source distribution | ||
run: | | ||
PACKAGE="ibm_db-$VERSION" | ||
cd dist | ||
tar -xzf $PACKAGE.tar.gz | ||
rm -rf $PACKAGE/clidriver* | ||
rm -rf $PACKAGE.tar.gz | ||
tar -czf $PACKAGE.tar.gz $PACKAGE | ||
rm -rf $PACKAGE | ||
env: | ||
VERSION: ${{ steps.version.outputs.VERSION}} | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./dist/*.tar.gz | ||
path: | | ||
./dist/*.tar.gz | ||
upload_pypi: | ||
needs: [build_sdist,build_wheels_macos_linux, build_wheels_windows_64,build_wheels_windows_32] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
#upload to PyPI on every tag starting with 'v' | ||
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
# alternatively, to publish when a GitHub Release is created, use the following rule: | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
# unpacks default artifact into dist/ | ||
# if `name: artifact` is omitted, the action will create extra parent dir | ||
name: Upload to testpypi | ||
path: dist | ||
- uses: pypa/[email protected] | ||
with: | ||
user: ${{secrets.TESTPYPI_USER}} | ||
password: ${{secrets.TESTPYPI_PASSWORD}} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
|
||
- name: Upload to PYPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: ${{secrets.TESTPYPI_USER}} | ||
password: ${{secrets.TESTPYPI_PASSWORD}} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
# unpacks default artifact into dist/ | ||
#if `name: artifact` is omitted, the action will create extra parent dir | ||
name: artifact | ||
path: dist | ||
- name: Publish distribution to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: ${{secrets.TESTPYPI_USER}} | ||
password: ${{ secrets.TESTPYPI_PASSWORD}} | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
- name: Publish distribution to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: ${{secrets.PYPI_USER}} | ||
password: ${{ secrets.PYPI_PASSWORD}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters