Skip to content

Commit 1debd81

Browse files
committed
add new line at EOF of version file and fix script to trim it. Address nits in release github
1 parent 2e6d5e5 commit 1debd81

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.1
1+
0.3.1

.github/workflows/release.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: "Version number"
7+
description: "New version for the SDKs in the format of M.m.p"
88
required: true
99
type: string
1010
build_number:
11-
description: "Build number "
11+
description: "New build number for the SDKs in the format of Mmmppbb "
1212
required: true
1313
type: string
1414

1515
jobs:
1616
prepare-release:
1717
runs-on: ubuntu-latest
1818
if: startsWith(github.ref, 'refs/heads/sdk-core/') # Only run on branches that start with sdk-core/
19+
env:
20+
VERSION: ${{ github.event.inputs.version }}
21+
BUILD_NUMBER: ${{ github.event.inputs.build_number }}
1922
steps:
2023
- name: Checkout the code
2124
uses: actions/checkout@v4
@@ -28,22 +31,11 @@ jobs:
2831
git_user_signingkey: true
2932
git_commit_gpgsign: true
3033

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-
4234
- name: Run the Prep Release Script
4335
env:
4436
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4537
run: |
46-
make prep-release VERSION="$VERSION" BUILD_NUMBER="$BUILD_NUMBER"
38+
make prep-release VERSION="{{ env.SDK_VERSION }}" BUILD_NUMBER="{{ env.SDK_BUILD_NUMBER }}"
4739
shell: bash
4840

4941
build-wheels:
@@ -52,6 +44,7 @@ jobs:
5244
if: startsWith(github.ref, 'refs/heads/sdk-core/')
5345
needs: [prepare-release]
5446
strategy:
47+
# we don't want all of them failing if one fails
5548
fail-fast: false
5649
matrix:
5750
# macOS 13 is an Intel runner and macOS 14 is an Apple Silicon runner
@@ -75,17 +68,24 @@ jobs:
7568
7669
- name: Build wheels
7770
env:
71+
# Skip all the unneeded images like PyPy and musllinux images
7872
CIBW_SKIP: pp* *-musllinux_*
73+
# Set the manylinux X86_64/aarch64 image to this specific 2.34 image
7974
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux_2_34_x86_64"
8075
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux_2_34_aarch64"
76+
# Set the wheel to the native archtiecture (output of platform.machine() which we use in the setup.py script)
8177
CIBW_ARCHS: "native"
78+
# Windows reparing of wheels are not supported so manually install it.
8279
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
8380
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
81+
# Dependencies required for testing each wheel
8482
CIBW_TEST_REQUIRES: "pydantic pytest pytest-asyncio"
83+
# The minimum MacOS version for darwin wheels (matches OPH)
8584
MACOSX_DEPLOYMENT_TARGET: "12.0"
85+
# The command to test every wheel
8686
CIBW_TEST_COMMAND: "python -m pytest {project}/src/onepassword/test_client.py"
87-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TEST_SERVICE_ACCOUNT_TOKEN }}
88-
CIBW_ENVIRONMENT_PASS_LINUX: OP_SERVICE_ACCOUNT_TOKEN # We have to specify this to pass the token to the test command
87+
# Pass the service account token in all wheel buildings for testing of the wheels.
88+
CIBW_ENVIRONMENT: OP_SERVICE_ACCOUNT_TOKEN=${{ secrets.TEST_SERVICE_ACCOUNT_TOKEN }}
8989
run: |
9090
python -m cibuildwheel --output-dir dist
9191

src/release/scripts/prep-release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ build_number_template_file="src/release/templates/build_number.tpl.py"
88

99

1010
# Extracts the current build/version number for comparison and backup
11-
current_version=$(cat "$output_version_file")
12-
current_build=$(awk -F "['\"]" '/SDK_BUILD_NUMBER =/{print $2}' "$output_build_file")
11+
current_version=$(cat "$output_version_file" | tr -d '[:space:]')
12+
current_build=$(awk -F "['\"]" '/SDK_BUILD_NUMBER =/{print $2}' "$output_build_file" | tr -d '[:space:]')
1313

1414
# Function to execute upon exit
1515
cleanup() {

0 commit comments

Comments
 (0)