forked from ibm-messaging/mq-mqi-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Initial github workflow. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adiroiban
wants to merge
25
commits into
main
Choose a base branch
from
chevah-2.0.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
66d2cde
Initial github workflow.
adiroiban 17eff3c
Forgot the MQ_FILE_PATH.
adiroiban 53b0e2d
Make GitHub Action dedicated to the release process.
adiroiban abd48e2
Upload wheels.
adiroiban 41df71f
Add release docs.
adiroiban b270f2c
Create separate wheel package for C libraries.
adiroiban 2497f89
Add support for dummy packages.
adiroiban d57b77f
Fix C libs for Linux.
adiroiban cee22d6
Release a new IBM MQ C redistribubalte
adiroiban 88b4ac3
Update to 9.4.4.0. Add custom version for ibmmq.
adiroiban bb15440
Merge upstream.
adiroiban a9e159b
Fix files for 9.4.4.0.
adiroiban 24ff049
Try to run the server container.
adiroiban 6b2d49b
Try to build using cibuildwheel.
adiroiban 9219e2f
Fix build.
adiroiban e1a414d
Debug MQ_FILE_PATH.
adiroiban 675e18b
Debug linux build.
adiroiban 77e2ba6
Separate build for linux and windows.
adiroiban 00645bf
Try env variables.
adiroiban 7cc46a7
Revert to direct build.
adiroiban ec338b9
Enable pure python wheels.
adiroiban bf2d979
Enable chevah sepecific version.
adiroiban 36a2f63
Create glibc specific linux.
adiroiban 01d21d6
Fix placeholder platform name.
adiroiban f74428e
Fix Windows DLLs.
adiroiban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| name: Release | ||
| on: | ||
| push: | ||
| branches: | ||
| - default | ||
| # To simplify the release process, the publishing is triggered on tag. | ||
| # We should make sure to only push tags for new releases. | ||
| # If we start using tags for non-release purposes, | ||
| # this needs to be updated. | ||
| # | ||
| # We need to explicitly configure an expression that matches anything. | ||
| tags: [ "**" ] | ||
| pull_request: | ||
|
|
||
|
|
||
| env: | ||
| LINUX_URL: "https://bin.chevah.com:20443/third-party-stuff/ibm-mqc-redist/9.4.3.1-IBM-MQC-Redist-LinuxX64.tar.gz" | ||
| WINDOWS_URL: "https://bin.chevah.com:20443/third-party-stuff/ibm-mqc-redist/9.4.3.1-IBM-MQC-Redist-Win64.zip" | ||
|
|
||
| defaults: | ||
| run: | ||
| # Use bash on Windows for consistency. | ||
| shell: bash | ||
|
|
||
|
|
||
| jobs: | ||
| build_wheels: | ||
| name: Build ${{ matrix.runs-on }} | ||
| runs-on: ${{ matrix.runs-on }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| runs-on: [ubuntu-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v4 | ||
| name: Install Python | ||
| with: | ||
| python-version: '3.9' | ||
|
|
||
| - name: Install deps | ||
| run: | | ||
| python -m pip install -r tools/requirements-dev.txt | ||
|
|
||
| - name: Get IBM MQ C Linux Redistributables | ||
| if: matrix.runs-on == 'ubuntu-latest' | ||
| run: | | ||
| python tools/getRedistributables.py "$LINUX_URL" ibm-mq-c | ||
|
|
||
| - name: Get IBM MQ C Windows Redistributables | ||
| if: matrix.runs-on == 'windows-latest' | ||
| run: | | ||
| python tools/getRedistributables.py "$WINDOWS_URL" ibm-mq-c | ||
|
|
||
| - name: Build ibmmq wheels | ||
| run: | | ||
| export MQ_FILE_PATH=`pwd`/ibm-mq-c | ||
| python -m build --wheel | ||
|
|
||
| - name: Build C redistributables wheels | ||
| run: | | ||
| export MQ_FILE_PATH=`pwd`/ibm-mq-c | ||
| python -m build --wheel code/mqcredist | ||
| mv code/mqcredist/dist/*.whl dist/ | ||
|
|
||
| - name: Check files | ||
| run: ls -al dist/ | ||
|
|
||
| - name: Audit ABI3 wheels | ||
| run: | | ||
| abi3audit -vsS dist/*.whl | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: artifact-wheels-${{ matrix.runs-on }} | ||
| path: ./dist/*.whl | ||
|
|
||
|
|
||
| build_sdist: | ||
| name: Build source distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v4 | ||
| name: Install Python | ||
| with: | ||
| python-version: '3.9' | ||
|
|
||
| - name: Install build | ||
| run: | | ||
| python -m pip install build | ||
|
|
||
| - name: Build sdist and NOOP wheels | ||
| run: python -m build | ||
|
|
||
| - name: Build NOOP redistributables wheels | ||
| run: | | ||
| python -m build --wheel code/mqcredist | ||
| mv code/mqcredist/dist/*.whl dist/ | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: artifact-sdist | ||
| path: dist/* | ||
|
|
||
|
|
||
| upload_pypi: | ||
| needs: [build_wheels, build_sdist] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # IMPORTANT: this permission is mandatory for trusted publishing | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: artifact-* | ||
| merge-multiple: true | ||
| path: dist | ||
|
|
||
| - name: Check files | ||
| run: ls -al dist/ | ||
|
|
||
| - name: Publish to PyPI - on tag | ||
| # Skip upload to PyPI if we don't have a tag | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| uses: pypa/gh-action-pypi-publish@release/v1 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # IBM MQ C libraries distributed as a Python package | ||
|
|
||
| This is a NOOP Python package designed to simplify the distribution of IBM MQ C | ||
| library files. | ||
| Designed to be used together with `ibmmq`. | ||
|
|
||
| They only support Windows X64 and Linux GLIC X64. | ||
|
|
||
| For all the other platforms, an empty wheel is generated. | ||
| This is designed to help unify the requirements for the dev tools. | ||
| You can then handle the empty wheel at the application level. | ||
|
|
||
|
|
||
| ## Linux Usage | ||
|
|
||
| You need to use `LD_LIBRARY_PATH` to load the IBM C shared libraries. | ||
| They will be installed inside the virtual environment, at `lib/ibm-mq` path. | ||
|
|
||
| ``` | ||
| export LD_LIBRARY_PATH=YOUR_VENV/lib/ibm-mq/lib64/:YOUR_VENV/lib/ibm-mq/gskit8/lib64/ | ||
| python your_ibm_mq_sample_code.py | ||
| ``` | ||
|
|
||
|
|
||
| ## Windows Usage | ||
|
|
||
| The Microsoft Visual C++ 2013 Redistributable is required to build on | ||
| Windows systems. | ||
| This is a limitation of the IBM MQ C Client library. | ||
| The DLLs are copied in the wheel, so you don't need to install this on the | ||
| target systems. | ||
|
|
||
| The package copies the the IBM MQ libraries at `lib/ibm-mq` folder inside your | ||
| virtual environment. | ||
|
|
||
| You will need to setup Python to load the DLL from there. | ||
|
|
||
| ```python | ||
| import os | ||
|
|
||
| if os.name == 'nt': | ||
| base_dll_dir = os.path.join(os.path.dirname(sys.executable), 'ibm-mq') | ||
| os.add_dll_directory(base_dll_dir) | ||
|
|
||
| import pymqi | ||
| ``` | ||
|
|
||
| ## Licence | ||
|
|
||
| From the `licences/English.txt` found in the IBM MQ C redist archive: | ||
|
|
||
| > Redistributables may be distributed, in object-code form, only as part of Licensee's value-added application that was developed using the Program ("Licensee's Application") and only to support use of Licensee's Application. | ||
|
|
||
| I guess that this Python Package "application" adds some value, so the license is ok. |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #include <Python.h> | ||
| /* This does nothing. Here to trigger building binary wheels. */ | ||
|
|
||
| /* Module initialization */ | ||
| static PyMethodDef module_methods[] = { | ||
| {NULL} /* Sentinel */ | ||
| }; | ||
|
|
||
| PyMODINIT_FUNC PyInit_mqcredist(void) | ||
| { | ||
| static struct PyModuleDef moduledef = { | ||
| PyModuleDef_HEAD_INIT, "mqcredist", "Noop module", -1, module_methods, | ||
| }; | ||
| return PyModule_Create(&moduledef); | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| [build-system] | ||
| requires = ["setuptools"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
|
|
||
| [project] | ||
| name = "mqcredist" | ||
| version = "9.4.3" | ||
| description = "IBM MQ C library, distributed as wheels" | ||
| maintainers = [ | ||
| {name = "Adi Roiban", email = "adiroiban@gmail.com"}, | ||
| ] | ||
| requires-python = ">= 3.9" | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| ] | ||
| license = "LicenseRef-IBM-MQ-C-Redist" | ||
| license-files = ['LICENSE.txt'] | ||
| [project.urls] | ||
| Homepage = "https://github.com/ibm-messaging/mq-mqi-python" | ||
|
|
||
| [options] | ||
| packages = "find:" | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import os | ||
| from setuptools import setup, Extension | ||
|
|
||
| # | ||
| # This only supports Windows X64 and Linux GLIBC X64. | ||
| # | ||
|
|
||
| # Used to distribute the IBM MQ shared libraries with the wheel. | ||
| data_files = [] | ||
| mq_file_path = os.environ.get('MQ_FILE_PATH', '') | ||
|
|
||
| if os.name == 'nt': | ||
| data_files = [ | ||
| ('ibm-mq/', [ | ||
| mq_file_path + '/bin64/mqe.dll', | ||
| mq_file_path + '/bin64/mqic.dll', | ||
|
adiroiban marked this conversation as resolved.
Outdated
|
||
| ]), | ||
| ('ibm-mq/conv', [ | ||
| mq_file_path + '/conv/ccsid.tbl', | ||
| mq_file_path + '/conv/ccsid_part2.tbl', | ||
| ]), | ||
| ('ibm-mq/bin64', [ | ||
| mq_file_path + '/bin64/libcurl.dll', | ||
| ]), | ||
| ('ibm-mq/gskit8/lib64/', [ | ||
| mq_file_path + '/gskit8/lib64/capicmd_res.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8acmeidup_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8cms_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8dbfl_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8iccs_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8kicc_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8km_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8p11_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8ssl_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8sys_64.dll', | ||
| mq_file_path + '/gskit8/lib64/gsk8valn_64.dll', | ||
| # VC++ 2012 runtime dependencies. | ||
| 'c:/windows/system32/msvcp120.dll', | ||
| 'c:/windows/system32/msvcr120.dll', | ||
|
adiroiban marked this conversation as resolved.
|
||
| ]), | ||
| ('ibm-mq/gskit8/lib64/N/icc/icclib', [ | ||
| mq_file_path + '/gskit8/lib64/N/icc/icclib/ICCSIG.txt', | ||
| mq_file_path + '/gskit8/lib64/N/icc/icclib/icclib085.dll', | ||
| ]), | ||
| ] | ||
| else: | ||
| data_files = [ | ||
| ('lib/ibm-mq/lib', [ | ||
| mq_file_path + '/lib/ccsid.tbl', | ||
| mq_file_path + '/lib/ccdt_schema.json', | ||
| mq_file_path + '/lib/ccsid_part2.tbl', | ||
| ]), | ||
| ('lib/ibm-mq/lib64', [ | ||
| mq_file_path + '/lib64/libmqe_r.so', | ||
| mq_file_path + '/lib64/libmqe_r.so', | ||
|
adiroiban marked this conversation as resolved.
Outdated
|
||
| mq_file_path + '/lib64/libcurl.so', | ||
| ]), | ||
| ('lib/ibm-mq/gskit8/lib64', [ | ||
| mq_file_path + '/gskit8/lib64/libgsk8acmeidup_64.so', | ||
| mq_file_path + '/gskit8/lib64/libgsk8cms_64.so', # curl | ||
| mq_file_path + '/gskit8/lib64/libgsk8dbfl_64.so', | ||
| mq_file_path + '/gskit8/lib64/libgsk8iccs_64.so', | ||
| mq_file_path + '/gskit8/lib64/libgsk8kicc_64.so', | ||
| mq_file_path + '/gskit8/lib64/libgsk8km_64.so', | ||
| mq_file_path + '/gskit8/lib64/libgsk8p11_64.so', | ||
| mq_file_path + '/gskit8/lib64/libgsk8ssl_64.so', # curl | ||
| mq_file_path + '/gskit8/lib64/libgsk8sys_64.so', # curl | ||
| mq_file_path + '/gskit8/lib64/libgsk8valn_64.so', | ||
| ]), | ||
| ('lib/ibm-mq/gskit8/lib64/N/icc/icclib', [ | ||
| mq_file_path + '/gskit8/lib64/N/icc/icclib/ICCSIG.txt', | ||
| mq_file_path + '/gskit8/lib64/N/icc/icclib/libicclib085.so', # curl | ||
| ]), | ||
| ] | ||
|
|
||
| if not mq_file_path and os.environ.get('CI', '') == '': | ||
| raise Exception( | ||
| "Use the MQ_FILE_PATH environment variable to identify " | ||
| "the path where IBM MQ C redistributables are located.") | ||
|
|
||
| if not mq_file_path: | ||
| # We are in the CI environment, so just build a noop package. | ||
| setup() | ||
| else: | ||
| setup( | ||
| data_files=data_files, | ||
| ext_modules=[Extension( | ||
| "mqcredist", | ||
| sources=["mqcredist.c"], | ||
| define_macros=[("Py_LIMITED_API", "0x03090000")], | ||
| py_limited_api=True, | ||
| )], | ||
| options={"bdist_wheel": {"py_limited_api": "cp39"}}, | ||
| ) | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Release | ||
|
|
||
| GitHub Action is used to build the release files and publish them on PyPi. | ||
| This is automatically triggered when a new tag is created. | ||
|
|
||
|
|
||
| ## Pre-release steps | ||
|
|
||
| * Create a new branch with a name that starts with `release-`. | ||
| Ex: `release-2.1.0` | ||
| * Update the version inside setup.py | ||
| * Update CHANGELOG.md with the latest version and release date. | ||
| Add a note to the IBM MQ C Redistributables version used for this release. | ||
| * Create a pull request and make sure all checks pass. | ||
| The wheels are generated as part of the PR checks, | ||
| but they are not yet published to PyPI. | ||
|
|
||
|
|
||
| ## Release steps | ||
|
|
||
| * Use [GitHub Release](https://github.com/ibm-messaging/mq-mqi-python/releases/new) to create a new release together with a new tag. | ||
| * You don't have to create a GitHub Release, the important part is to | ||
| create a new tag. | ||
| * The tag value is the version. Without any prefix. | ||
| * Once a tag is pushed to the repo, GitHub Action will re-run all the jobs | ||
| and will publish to PyPI. | ||
|
|
||
|
|
||
| ## Post-release steps | ||
|
|
||
| * Update the version inside setup.py to the next development version. | ||
| Increment the micro version and add a .dev0 suffix. | ||
| * Merge the pull request |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.