Skip to content

Commit c63f59b

Browse files
committed
Clean up files and change version.txt to .VERSION
1 parent 55c7792 commit c63f59b

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

.VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.3.1

.github/workflows/wheels.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build_wheels:
1111
name: Build wheels for Python SDK on ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
13-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'sdk-core/')
13+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'sdk-core/')
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -23,7 +23,7 @@ jobs:
2323

2424
# Need to grab the SDK version for the wheel name
2525
- name: Extract SDK Version
26-
run: echo "SDK_VERSION=$(cat version.txt)" >> "$GITHUB_ENV"
26+
run: echo "SDK_VERSION=$(cat .VERSION)" >> "$GITHUB_ENV"
2727
shell: bash
2828

2929
- name: Install cibuildwheel
@@ -54,12 +54,12 @@ jobs:
5454
build-sdist:
5555
name: Build source distribution for Python SDK
5656
runs-on: ubuntu-latest
57-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'sdk-core/')
57+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'sdk-core/')
5858
steps:
5959
- uses: actions/checkout@v4
6060

6161
- name: Extract SDK Version
62-
run: echo "SDK_VERSION=$(cat version.txt)" >> "$GITHUB_ENV"
62+
run: echo "SDK_VERSION=$(cat .VERSION)" >> "$GITHUB_ENV"
6363
shell: bash
6464

6565
- name: Install dependencies
@@ -83,7 +83,7 @@ jobs:
8383
publish-to-pypi:
8484
name: Publish to PyPI
8585
runs-on: ubuntu-latest
86-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'sdk-core/')
86+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'sdk-core/')
8787
environment:
8888
name: pypi
8989
url: https://pypi.org/project/onepassword-sdk/

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ dependencies = [
3030
Homepage = "https://github.com/1Password/onepassword-sdk-python"
3131

3232
[tool.setuptools.dynamic]
33-
version = {file = "./version.txt"}
33+
version = {file = "./.VERSION"}

src/release/scripts/build-wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ macOS_version_x86_64=10.9
1313
macOS_version_arm64=11.0
1414

1515
# Extracts the current verison number for cleanup function
16-
current_version=$(cat version.txt)
16+
current_version=$(cat .VERSION)
1717

1818
# Function to execute upon exit
1919
cleanup() {
2020
echo "Performing cleanup tasks..."
2121
# Remove dist and egg-info and the potential release candidate if created
2222
rm -r dist src/*.egg-info/ onepassword_sdk-"${current_version}"
23-
exit 1
23+
exit 1
2424
}
2525

2626
# Set the trap to call the cleanup function on exit
@@ -42,7 +42,7 @@ build_wheels() {
4242
export PYTHON_OS_PLATFORM=$os_platform
4343
export PYTHON_MACHINE_PLATFORM=$machine_platform
4444

45-
case "$os_platform" in
45+
case "$os_platform" in
4646
Darwin)
4747
macos_version=
4848
# Min MacOS version for Python 3.13+ is 10.13

src/release/scripts/prep-release.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
# Helper script to prepare a release for the Python SDK.
44

5-
output_version_file="version.txt"
5+
output_version_file=".VERSION"
66
output_build_file="src/onepassword/build_number.py"
77
build_number_template_file="src/release/templates/build_number.tpl.py"
88

99

10-
# Extracts the current build/version number for comparison and backup
10+
# Extracts the current build/version number for comparison and backup
1111
current_version=$(cat "$output_version_file")
1212
current_build=$(awk -F "['\"]" '/SDK_BUILD_NUMBER =/{print $2}' "$output_build_file")
1313

@@ -17,7 +17,7 @@ cleanup() {
1717
# Revert changes to file if any
1818
echo -n "$current_version" > "$output_version_file"
1919
sed -e "s/{{ build }}/$current_build/" "$build_number_template_file" > "$output_build_file"
20-
exit 1
20+
exit 1
2121
}
2222

2323
# Set the trap to call the cleanup function on exit
@@ -38,14 +38,14 @@ update_and_validate_version() {
3838
read -p "Enter the version number (format: x.y.z(-beta.w)): " version
3939

4040
# Validate the version number format
41-
if [[ "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?$ ]]; then
41+
if [[ "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?$ ]]; then
4242
if [[ "${current_version}" != "${version}" ]]; then
4343
# TODO: Check the less than case as well.
4444
echo "New version number is: ${version}"
4545
return 0
4646
else
4747
echo "Version hasn't changed."
48-
fi
48+
fi
4949
else
5050
echo "Invalid version number format: ${version}"
5151
echo "Please enter a version number in the 'x.y.z(-beta.w)' format."
@@ -54,7 +54,7 @@ update_and_validate_version() {
5454
}
5555

5656
# Function to validate the build number format.
57-
# SEMVER Format: Mmmppbb - 7 Digits
57+
# SEMVER Format: Mmmppbb - 7 Digits
5858
update_and_validate_build() {
5959
while true; do
6060
# Prompt the user to input the build number
@@ -83,9 +83,9 @@ enforce_latest_code
8383
update_and_validate_version
8484

8585
# Update and validate the build number
86-
update_and_validate_build
86+
update_and_validate_build
8787

88-
# Update version & build number in version.txt and build_number.py respectively
88+
# Update version & build number in .VERSION and build_number.py respectively
8989
echo -n "$version" > "$output_version_file"
9090
sed -e "s/{{ build }}/$build/" "$build_number_template_file" > "$output_build_file"
9191

src/release/scripts/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set -e
66

77
# Read the contents of the files into variables
8-
version=$(cat "version.txt")
8+
version=$(cat ".VERSION")
99
build=$(awk -F "['\"]" '/SDK_BUILD_NUMBER =/{print $2}' "src/onepassword/build_number.py")
1010
release_notes=$(< src/release/RELEASE-NOTES)
1111

version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)