1- name : Release SDK
1+ name : Release Python SDKs
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ version :
7+ description : " Version number"
8+ required : true
9+ type : string
10+ build_number :
11+ description : " Build number "
12+ required : true
13+ type : string
514
615jobs :
7- build_wheels :
16+ prepare-release :
17+ runs-on : ubuntu-latest
18+ if : startsWith(github.ref, 'refs/heads/sdk-core/') # Only run on branches that start with sdk-core/
19+ steps :
20+ - name : Checkout the code
21+ uses : actions/checkout@v4
22+
23+ - name : Import GPG key
24+ uses : crazy-max/ghaction-import-gpg@v6
25+ with :
26+ gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
27+ passphrase : ${{ secrets.PASSPHRASE }}
28+ git_user_signingkey : true
29+ git_commit_gpgsign : true
30+
31+ - name : Parse and Validate Inputs
32+ run : |
33+ # Get inputs passed to the workflow
34+ VERSION="${{ github.event.inputs.version }}"
35+ BUILD_NUMBER="${{ github.event.inputs.build_number }}"
36+
37+ # Save the parsed values for future steps
38+ echo "VERSION=$VERSION" >> $GITHUB_ENV
39+ echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
40+ shell : bash
41+
42+ - name : Run the Prep Release Script
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+ run : |
46+ make prep-release VERSION="$VERSION" BUILD_NUMBER="$BUILD_NUMBER"
47+ shell : bash
48+
49+ build-wheels :
850 name : Build wheels for Python SDK on ${{ matrix.os }}
951 runs-on : ${{ matrix.os }}
1052 if : startsWith(github.ref, 'refs/heads/sdk-core/')
53+ needs : [prepare-release]
1154 strategy :
1255 fail-fast : false
1356 matrix :
1457 # macOS 13 is an Intel runner and macOS 14 is an Apple Silicon runner
1558 os : [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
1659 steps :
1760 - uses : actions/checkout@v4
61+ with :
62+ ref : ${{ github.ref }}
63+
1864 - name : Upgrade build dependencies
1965 run : python -m pip install --upgrade pip setuptools wheel
2066
3278 CIBW_SKIP : pp* *-musllinux_*
3379 CIBW_MANYLINUX_X86_64_IMAGE : " quay.io/pypa/manylinux_2_34_x86_64"
3480 CIBW_MANYLINUX_AARCH64_IMAGE : " quay.io/pypa/manylinux_2_34_aarch64"
35- CIBW_ARCHS : " native" # Equivalent to python's platform.machine()
81+ CIBW_ARCHS : " native"
3682 CIBW_BEFORE_BUILD_WINDOWS : " pip install delvewheel"
3783 CIBW_REPAIR_WHEEL_COMMAND_WINDOWS : " delvewheel repair -w {dest_dir} {wheel}"
3884 CIBW_TEST_REQUIRES : " pydantic pytest pytest-asyncio"
5298 name : Build source distribution for Python SDK
5399 runs-on : ubuntu-latest
54100 if : startsWith(github.ref, 'refs/heads/sdk-core/')
101+ needs : [prepare-release]
55102 steps :
56103 - uses : actions/checkout@v4
57-
104+ with :
105+ ref : ${{ github.ref }}
106+ # Need to grab the SDK version for the wheel name
58107 - name : Extract SDK Version
59108 run : echo "SDK_VERSION=$(cat .VERSION)" >> "$GITHUB_ENV"
60109 shell : bash
@@ -77,14 +126,15 @@ jobs:
77126 name : onepassword-sdk-${{ env.SDK_VERSION }}
78127 path : ./dist/*.tar.gz
79128
80- release-sdk :
129+ Release-SDK :
81130 runs-on : ubuntu-latest
82131 if : startsWith(github.ref, 'refs/heads/sdk-core/') # Only run on branches that start with sdk-core/
132+ needs : [build-wheels, build-sdist]
83133 steps :
84134 - name : Checkout the code
85135 uses : actions/checkout@v4
86136 with :
87- token : ${{ secrets.PAT }}
137+ ref : ${{ github.ref }}
88138
89139 - name : Import GPG key
90140 uses : crazy-max/ghaction-import-gpg@v6
@@ -110,7 +160,7 @@ jobs:
110160 url : https://pypi.org/project/onepassword-sdk/
111161 permissions :
112162 id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
113- needs : [build_wheels, build-sdist ]
163+ needs : [Release-SDK ]
114164 steps :
115165 - uses : actions/download-artifact@v4
116166 with :
0 commit comments