Skip to content

Commit 36300f7

Browse files
Allow building of specified packages.
1 parent df5c280 commit 36300f7

File tree

3 files changed

+63
-15
lines changed

3 files changed

+63
-15
lines changed

.github/workflows/build.yaml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
name: build
1+
name: Build python-oracledb packages
22

33
on:
44
push:
55
tags:
66
- v*
77
workflow_dispatch:
8+
inputs:
9+
tgt:
10+
description: List of package targets to build
11+
default: 'Linux, macOS, Windows, Source'
12+
required: false
813

914
jobs:
1015

1116
build_source_package:
1217
name: Build source package
18+
if: contains(inputs.tgt, 'Source') || inputs.tgt == ''
1319
runs-on: ubuntu-latest
1420
steps:
1521

@@ -36,6 +42,7 @@ jobs:
3642

3743
build_linux_wheels:
3844
name: Build wheels for Linux
45+
if: contains(inputs.tgt, 'Linux') || inputs.tgt == ''
3946
runs-on: ${{ matrix.os }}
4047
strategy:
4148
matrix:
@@ -82,12 +89,13 @@ jobs:
8289
name: Linux_${{ matrix.platform }}_wheels
8390
path: dist/*.whl
8491

85-
build_non_linux_wheels:
92+
build_macos_wheels:
8693
name: Build wheels for ${{ matrix.os }} Python-${{ matrix.python-version}}-${{ matrix.arch }}
94+
if: contains(inputs.tgt, 'macOS') || inputs.tgt == ''
8795
runs-on: ${{ matrix.os }}
8896
strategy:
8997
matrix:
90-
os: [windows-latest, macos-latest]
98+
os: [macos-latest]
9199
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
92100
arch: ['x86', '']
93101
exclude:
@@ -118,9 +126,44 @@ jobs:
118126
name: python-oracledb-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.arch }}
119127
path: dist/*.whl
120128

129+
build_windows_wheels:
130+
name: Build wheels for ${{ matrix.os }} Python-${{ matrix.python-version}}-${{ matrix.arch }}
131+
if: contains(inputs.tgt, 'Windows') || inputs.tgt == ''
132+
runs-on: ${{ matrix.os }}
133+
strategy:
134+
matrix:
135+
os: [windows-latest]
136+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
137+
arch: ['x86', '']
138+
139+
steps:
140+
- uses: actions/checkout@v4
141+
with:
142+
submodules: true
143+
144+
- uses: actions/setup-python@v5
145+
with:
146+
cache: 'pip'
147+
python-version: ${{ matrix.python-version }}
148+
architecture: ${{ matrix.arch }}
149+
allow-prereleases: true
150+
151+
- name: Ensure build package is present
152+
run: python -m pip install build
153+
154+
- name: Build wheel for Python ${{ matrix.python-version }}
155+
run: python -m build
156+
157+
- name: Upload the artifact
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: python-oracledb-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.arch }}
161+
path: dist/*.whl
162+
121163
combine_artifacts:
122164
name: Combine artifacts into single artifact
123-
needs: [build_source_package, build_linux_wheels, build_non_linux_wheels]
165+
if: ${{ always() }}
166+
needs: [build_source_package, build_linux_wheels, build_macos_wheels, build_windows_wheels]
124167
runs-on: ubuntu-latest
125168

126169
steps:

doc/src/release_notes.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ Common Changes
6868

6969
#) Added parameter ``pool_name`` to connection and pool creation methods to
7070
support Oracle Database 23ai multi-pool :ref:`drcp`.
71-
#) Use GitHub Arm Linux runner for builds. Supplied by wojiushixiaobai
72-
(`PR 496 <https://github.com/oracle/python-oracledb/pull/496>`__).
73-
#) Fix bug with GitHub build action merge artifacts step
74-
(`issue 495 <https://github.com/oracle/python-oracledb/issues/495>`__).
71+
#) :ref:`GitHub Action <installghactions>` workflow updates:
72+
73+
- Use GitHub Arm Linux runner for builds. Supplied by wojiushixiaobai
74+
(`PR 496 <https://github.com/oracle/python-oracledb/pull/496>`__).
75+
- Allow the GitHub build action to build a user-chosen subset of packages.
76+
- Fix bug with GitHub build action merge artifacts step
77+
(`issue 495 <https://github.com/oracle/python-oracledb/issues/495>`__).
78+
7579
#) Error ``DPY-2064: parameter 'max' should be greater than or equal to
7680
parameter 'min'`` is now raised when a call to
7781
:meth:`oracledb.create_pool()`, :meth:`oracledb.create_pool_async()`

doc/src/user_guide/installation.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,19 +1010,20 @@ Python versions.
10101010
`ODPI-C repository <https://github.com/oracle/odpi/fork>`__, keeping the
10111011
default name.
10121012

1013-
2. Optionally edit ``.github/workflows/build.yaml`` and remove platforms and
1014-
versions that you are not interested in. Building all packages can take some
1015-
time.
1016-
1017-
3. In your python-oracledb fork, go to the Actions tab
1013+
2. In your python-oracledb fork, go to the Actions tab
10181014
``https://github.com/<your name>/python-oracledb/actions/``. If this is
10191015
your first time using Actions, confirm enabling them.
10201016

1021-
4. In the "All workflows" list on the left-hand side, select the "build" entry.
1017+
3. In the "All workflows" list on the left-hand side, select the "Build
1018+
python-oracledb packages" entry.
10221019

1023-
5. Navigate to the "Run workflow" drop-down, select the branch to build from
1020+
4. Navigate to the "Run workflow" drop-down, select the branch to build from
10241021
(for example, "main"), and run the workflow.
10251022

1023+
5. Optionally edit the input field list of package targets and remove targets
1024+
you do not want to build. For example, remove "Linux" if you do not want
1025+
Linux packages.
1026+
10261027
6. When the build has completed, download the "python-oracledb-wheels"
10271028
artifact, unzip it, and install the one for your architecture and Python
10281029
version. For example, when using Python 3.12 on macOS, install::

0 commit comments

Comments
 (0)