Skip to content

feat: [DX-2896] Track Unity SDK version #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 7, 2024
Merged
4 changes: 1 addition & 3 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:

- name: Extract version from package.json
id: extract_version
run: |
VERSION=$(jq -r .version ./src/Packages/Passport/package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
run: echo "VERSION=$(jq -r .version ./src/Packages/Passport/package.json)" >> $GITHUB_ENV

- name: Create Tag
uses: negz/create-tag@v1
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ jobs:
run: |
FILE=./src/Packages/Passport/package.json
VERSION=${{ github.event.inputs.version }}
jq --arg version "$VERSION" '.version = $version' "./src/Packages/Passport/package.json" > tmp.$$.json && mv tmp.$$.json "./src/Packages/Passport/package.json"
jq --arg version "$VERSION" '.version = $version' $FILE > tmp.$$.json && mv tmp.$$.json $FILE

- name: Replace engine sdk version string
id: replace_engine_sdk_version
run: |
FILE=./src/Packages/Passport/Runtime/Scripts/Private/Helpers/SdkVersionInfoHelpers.cs
VERSION=${{ github.event.inputs.version }}
sed -i "s/__ENGINE_SDK_VERSION__/$VERSION/g" $FILE

- uses: gr2m/create-or-update-pull-request-action@v1
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Immutable.Passport.Helpers
{
public class SdkVersionInfoHelpers
{
public static string GetSdkVersionInfo()
{
return "__ENGINE_SDK_VERSION__";
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class VersionInfo
{
public string engine;
public string engineVersion;
public string engineSdkVersion;
public string platform;
public string platformVersion;
public string deviceModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public async UniTask Init(string clientId, string environment, string redirectUr
{
engine = "unity",
engineVersion = Application.unityVersion,
engineSdkVersion = SdkVersionInfoHelpers.GetSdkVersionInfo(),
platform = Application.platform.ToString(),
platformVersion = SystemInfo.operatingSystem,
deviceModel = SystemInfo.deviceModel
Expand Down