1- name : Release Builder
1+ name : Wheels Builder and Publisher
22on :
33 pull_request :
44 branches :
@@ -12,17 +12,21 @@ jobs:
1212 runs-on : ${{ matrix.os }}
1313 if : github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'sdk-core/')
1414 strategy :
15- matrix :
16- # macOS 13 is an Intel runner and macOS 14 is an Apple Silicon runner
15+ fail-fast : false
16+ matrix :
17+ # macOS 13 is an Intel runner and macOS 14 is an Apple Silicon runner
1718 os : [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
1819 steps :
1920 - uses : actions/checkout@v4
21+ - name : Upgrade build dependencies
22+ run : python -m pip install --upgrade pip setuptools wheel
23+
2024
2125 # Need to grab the SDK version for the wheel name
2226 - name : Extract SDK Version
2327 run : echo "SDK_VERSION=$(cat version.txt)" >> "$GITHUB_ENV"
2428 shell : bash
25-
29+
2630 - name : Install cibuildwheel
2731 run : |
2832 python -m pip install cibuildwheel
@@ -33,10 +37,13 @@ jobs:
3337 CIBW_MANYLINUX_X86_64_IMAGE : " quay.io/pypa/manylinux_2_34_x86_64"
3438 CIBW_MANYLINUX_AARCH64_IMAGE : " quay.io/pypa/manylinux_2_34_aarch64"
3539 CIBW_ARCHS : " native"
40+ CIBW_BEFORE_BUILD_WINDOWS : " pip install delvewheel"
41+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS : " delvewheel repair -w {dest_dir} {wheel}"
3642 CIBW_TEST_REQUIRES : " pydantic pytest pytest-asyncio"
43+ MACOSX_DEPLOYMENT_TARGET : " 12.0"
3744 CIBW_TEST_COMMAND : " python -m pytest {project}/src/onepassword/test_client.py"
3845 OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.TEST_SERVICE_ACCOUNT_TOKEN }}
39- CIBW_ENVIRONMENT_PASS_LINUX : OP_SERVICE_ACCOUNT_TOKEN # to pass in the SA token, for some reason Linux doesn't read the env variables correctly
46+ CIBW_ENVIRONMENT_PASS_LINUX : OP_SERVICE_ACCOUNT_TOKEN # We have to specify this to pass the token to the test command
4047 run : |
4148 python -m cibuildwheel --output-dir dist
4249
@@ -55,13 +62,13 @@ jobs:
5562 - name : Extract SDK Version
5663 run : echo "SDK_VERSION=$(cat version.txt)" >> "$GITHUB_ENV"
5764 shell : bash
58-
65+
5966 - name : Install dependencies
6067 run : pip3 install build pydantic pytest pytest-asyncio
6168
6269 - name : Build source distribution
6370 run : python3 -m build --sdist
64-
71+
6572 - name : Test Source Distribution
6673 env :
6774 OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.TEST_SERVICE_ACCOUNT_TOKEN }}
7380 with :
7481 name : onepassword-sdk-${{ env.SDK_VERSION }}
7582 path : ./dist/*.tar.gz
76-
83+
7784 publish-to-pypi :
7885 name : Publish to PyPI
7986 runs-on : ubuntu-latest
@@ -82,13 +89,13 @@ jobs:
8289 name : pypi
8390 url : https://pypi.org/project/onepassword-sdk/
8491 permissions :
85- id-token : write # Required for PyPi trusted publishing
92+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
8693 needs : [build_wheels, build-sdist]
8794 steps :
8895 - uses : actions/download-artifact@v4
8996 with :
9097 pattern : onepassword-sdk-*
9198 path : ./dist
9299 merge-multiple : true
93- - name : Publish package distributions to PyPI
100+ - name : Publish package distributions to PyPi
94101 uses : pypa/gh-action-pypi-publish@release/v1.12
0 commit comments