Skip to content

Commit f999033

Browse files
fix: ensure PHP SDK version persistence and validation (#702)
* fix: ensure PHP SDK version persistence and validation Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> * fix: remove version fallback logic from workflow Co-Authored-By: Max Prilutskiy <maks.prilutskiy@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Max Prilutskiy <maks.prilutskiy@gmail.com>
1 parent bc25195 commit f999033

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/publish-php-sdk.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ jobs:
6464
- name: Get current version
6565
id: current_version
6666
run: |
67-
VERSION=$(php -r 'echo json_decode(file_get_contents("php/sdk/composer.json"), true)["version"];')
67+
VERSION=$(php -r '
68+
$composerJson = json_decode(file_get_contents("php/sdk/composer.json"), true);
69+
echo $composerJson["version"];
70+
')
6871
echo "version=$VERSION" >> $GITHUB_OUTPUT
6972
7073
- name: Bump patch version
@@ -73,7 +76,7 @@ jobs:
7376
# Get current version
7477
CURRENT_VERSION=${{ steps.current_version.outputs.version }}
7578
76-
# Use PHP to increment patch version instead of composer semver
79+
# Use PHP to increment patch version
7780
NEW_VERSION=$(php -r '
7881
$version = "${{ steps.current_version.outputs.version }}";
7982
list($major, $minor, $patch) = explode(".", $version);

php/sdk/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lingodotdev/sdk",
33
"description": "Official PHP SDK for Lingo.dev",
4-
"version": "",
4+
"version": "0.1.0",
55
"type": "library",
66
"license": "MIT",
77
"autoload": {
@@ -28,4 +28,4 @@
2828
"cs": "phpcs src/ tests/",
2929
"cs-fix": "phpcbf src/ tests/"
3030
}
31-
}
31+
}

0 commit comments

Comments
 (0)