Skip to content

Commit

Permalink
feat: v1.3.0 changes from release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
srcnalt committed May 29, 2023
2 parents 975e93a + 00ccdf7 commit 8d5b49d
Show file tree
Hide file tree
Showing 57 changed files with 724 additions and 787 deletions.
23 changes: 23 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

COMMIT_MESSAGE="$(head -n1 "$1")"
COMMIT_MESSAGE_REGEX="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z ]+\))?: .+$"
AUTO_COMMIT_MESSAGE_REGEX="^Merge (pull request|branch) [a-zA-Z0-9#'_/-]+ (of [a-zA-Z0-9#':_. /-]+ )?(from|into) [a-zA-Z0-9#':_. /-]+$"


if [[ $COMMIT_MESSAGE =~ $COMMIT_MESSAGE_REGEX || $COMMIT_MESSAGE =~ $AUTO_COMMIT_MESSAGE_REGEX ]]; then
exit 0
else
echo "Invalid commit message format:"
echo "Your message: '${COMMIT_MESSAGE}'"
echo ""
echo "Please use the following format:"
echo "<type>(<scope>): <subject>"
echo ""
echo " the (<scope>) part is optional"
echo ""
echo "Examples:"
echo "feat(login): add support for email login"
echo "fix: fix issue with user profile image upload"
exit 1
fi
30 changes: 30 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

# Gitflow branching and naming strategy enforcement for Windows and Mac

protected_branches="^(main|develop|hotfix/|release/|feature/)"
current_branch=$(git symbolic-ref HEAD | sed 's!refs/heads/!!')

# Ensure the branch name adheres to the Gitflow naming strategy
if ! [[ ${current_branch} =~ ${protected_branches} ]]; then
echo "Error: The current branch '${current_branch}' does not adhere to the Gitflow naming strategy."
echo "Branch names must match the following patterns: main, develop, hotfix/*, release/*, feature/*."
exit 1
fi

# Check if pushing to the correct remote branch
remote_branch=$(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD))
if [[ -z "${remote_branch}" ]]; then
echo "Error: The current branch '${current_branch}' has no tracking remote branch."
exit 1
fi

remote_name=$(echo ${remote_branch} | cut -d/ -f1)
remote_branch_name=$(echo ${remote_branch} | cut -d/ -f2-)

if [[ "${current_branch}" != "${remote_branch_name}" ]]; then
echo "Error: The current branch '${current_branch}' must be pushed to a remote branch with the same name: '${remote_name}/${current_branch}'."
exit 1
fi

exit 0
11 changes: 5 additions & 6 deletions .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
This update includes an additional popup for the new Quick Start sample, operation completed event and README updates.
This update adds a small improvement to the module installer and a new setup guide editor window flow to help new users get started.

## Changelog

### Added
- support for response codes [#62](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/62)

### Updated
- refactor of WebRequestDispatcher [#59](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/59)
- import timeout to module installer [#70](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/70)
- Add new setup guide window [#71](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/71)
- added function for folder size in MB [#72](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/72)

This comment has been minimized.

Copy link
@PlayZAPGames

PlayZAPGames May 30, 2023

'DirectoryUtility' does not contain a definition for 'GetFolderSizeInMb'

This comment has been minimized.

Copy link
@srcnalt

srcnalt May 30, 2023

Author Contributor

Hi @PlayZAPGames, release tag was missing from the Core which caused it not to be updated. You can either rerun update checker from Ready Player Me menu or update core package via Package Manager window now.


### Fixed
- fixed an issue with the popup don't ask again pref was not updating correctly [#58](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/58)
- various editor window layout fixes [#73](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/73)
3 changes: 0 additions & 3 deletions .github/workflows.meta

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
name: "Ready Player Me Unity SDK: Core ${{github.ref_name}}"
name: "${{github.ref_name}}"
bodyFile: ".github/latest.md"
34 changes: 34 additions & 0 deletions .github/workflows/update-unity-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update unity sdk
on:
pull_request:
branches:
- develop
types: [closed]

jobs:
update-submodule:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repo with submodule
uses: actions/checkout@v3
with:
repository: "readyplayerme/Unity-SDK"
submodules: true
fetch-depth: 0
ref: develop
token: ${{ secrets.DEV_SDK_TOKEN }}

- name: Update submodule
run: |
cd Assets/Ready\ Player\ Me/Core
git checkout develop
git pull origin develop
- name: Commit and push changes
run: |
git config --global user.name "dev-sdk"
git config --global user.email "[email protected]"
git add .
git commit -m 'Update submodule'
git push origin develop
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.3.0] - Unreleased

### Added
- import timeout to module installer [#70](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/70)
- Add new setup guide window [#71](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/71)
- added function for folder size in MB [#72](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/72)

### Fixed
- various editor window layout fixes [#73](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/73)

## [1.2.0] - 2023.04.18

### Added
Expand Down
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ To get an overview of the project, read the [README](README.md). Here are some r
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
- [Code style guide](https://github.com/readyplayerme/rpm-unity-sdk-core/blob/main/style-guidelines.md)


## FAQ
Expand Down Expand Up @@ -83,6 +84,15 @@ Scan through our [existing issues](https://github.com/github/docs/issues) to fin

### Commit your update

We encourage following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format when it comes to writing commit messages. Our package repositories come with a .githooks folder that has a commit-msg file that can enforce this.
To set this up you just need to configure git's hookspath folder to point there.

You can do this by
1. Open the terminal
2. Navigate to the root folder of this repository
3. Run the following command
`git config core.hooksPath .githooks`

Commit the changes once you are happy with them. Don't forget to [self-review](#self-review) to speed up the review process:zap:.

### Self review
Expand All @@ -92,10 +102,10 @@ You should always review your own PR first.
For content changes, make sure that you:

- [ ] Confirm that the changes meet the user experience and goals outlined in the content design plan (if there is one).
- [ ] Compare your pull request's source changes to staging to confirm that the output matches the source and that everything is rendering as expected. This helps spot issues like typos, content that doesn't follow the style guide, or content that isn't rendering due to versioning problems. Remember that lists and tables can be tricky.
- [ ] Compare your pull request's source changes to staging to confirm that the output matches the source and that everything is rendering as expected. This helps spot issues like typos, content that doesn't follow the [style guide](https://github.com/readyplayerme/rpm-unity-sdk-core/blob/main/style-guidelines.md), or content that isn't rendering due to versioning problems. Remember that lists and tables can be tricky.
- [ ] Review the content for technical accuracy.
- [ ] Review the entire pull request using the [translations guide for writers](./translations/for-writers.md).
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the [style guide](#).
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the [style guide](https://github.com/readyplayerme/rpm-unity-sdk-core/blob/main/style-guidelines.md).
- [ ] Check new or updated Liquid statements to confirm that versioning is correct.
- [ ] If there are any failing checks in your PR, troubleshoot them until they're all passing.

Expand Down
5 changes: 3 additions & 2 deletions Editor/Analytics/AmplitudeEventLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void SetUserProperties()
{ Constants.Properties.RENDER_PIPELINE, appData.RenderPipeline },
{ Constants.Properties.SUBDOMAIN, appData.PartnerName },
{ Constants.Properties.APP_NAME, PlayerSettings.productName },
{ Constants.Properties.SDK_TARGET, "Unity" },
{ Constants.Properties.SDK_TARGET, SDK_TARGET },
{ Constants.Properties.APP_IDENTIFIER, Application.identifier },
{ Constants.Properties.ALLOW_ANALYTICS, true }
};
Expand Down Expand Up @@ -74,7 +74,7 @@ public async void LogEvent(string eventName, Dictionary<string, object> eventPro
{
eventData.Add(Constants.AmplitudeKeys.USER_PROPERTIES, userProperties);
}

if (eventProperties != null)
{
eventData.Add(Constants.AmplitudeKeys.EVENT_PROPERTIES, eventProperties);
Expand Down Expand Up @@ -133,6 +133,7 @@ private enum Target

private const string PRODUCTION = "unity";
private const string DEVELOPMENT = "unity-dev";
private const string SDK_TARGET = "Unity";

private string GetAnalyticsTarget()
{
Expand Down
4 changes: 2 additions & 2 deletions Editor/Module Management/ModuleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public string Identifier
return name;
}
// if branch not set, default to the version in ModuleList
return gitUrl + (string.IsNullOrEmpty(branch) ? $"#v{version}": $"#{branch}");
return gitUrl + (string.IsNullOrEmpty(branch) ? $"#v{version}" : $"#{branch}");

}
}
}
Expand Down
23 changes: 17 additions & 6 deletions Editor/Module Management/ModuleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEditor.Compilation;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;

namespace ReadyPlayerMe.Core.Editor
Expand All @@ -23,10 +24,14 @@ public static class ModuleInstaller
private const string PROGRESS_BAR_TITLE = "Ready Player Me";
private const string RPM_SCRIPTING_SYMBOL = "READY_PLAYER_ME";
private const string CORE_MODULE_NAME = "com.readyplayerme.core";

private const string MODULE_INSTALLATION_SUCCESS_MESSAGE =
"All the modules are installed successfully. Ready Player Me avatar system is ready to use.";
private const string MODULE_INSTALLATION_FAILURE_MESSAGE = "Something went wrong while installing modules.";
private const string ALL_MODULES_ARE_INSTALLED = "All modules are installed.";
private const string INSTALLING_MODULES = "Installing modules...";

private const float TIMEOUT_FOR_MODULE_INSTALLATION = 20f;

static ModuleInstaller()
{
Expand All @@ -46,7 +51,7 @@ private static void OnRegisteredPackages(PackageRegistrationEventArgs args)
{
InstallModules();
AppendScriptingSymbol();
EditorAssetGenerator.CreateSettingsAssets();
CoreSettingsHandler.CreateCoreSettings();
}
ValidateModules();
}
Expand All @@ -71,7 +76,7 @@ private static void OnRegisteringPackages(PackageRegistrationEventArgs args)
/// </summary>
private static void InstallModules()
{
EditorUtility.DisplayProgressBar(PROGRESS_BAR_TITLE, "Installing modules...", 0);
EditorUtility.DisplayProgressBar(PROGRESS_BAR_TITLE, INSTALLING_MODULES, 0);
Thread.Sleep(THREAD_SLEEP_TIME);

ModuleInfo[] missingModules = GetMissingModuleNames();
Expand All @@ -87,7 +92,7 @@ private static void InstallModules()
AddModuleRequest(module.Identifier);
}

EditorUtility.DisplayProgressBar(PROGRESS_BAR_TITLE, "All modules are installed.", 1);
EditorUtility.DisplayProgressBar(PROGRESS_BAR_TITLE, ALL_MODULES_ARE_INSTALLED, 1);
Thread.Sleep(THREAD_SLEEP_TIME);
}

Expand All @@ -100,15 +105,21 @@ private static void InstallModules()
/// <param name="identifier">The Unity package identifier of the module to be installed.</param>
public static void AddModuleRequest(string identifier)
{
var startTime = Time.realtimeSinceStartup;
AddRequest addRequest = Client.Add(identifier);
while (!addRequest.IsCompleted)
while (!addRequest.IsCompleted && Time.realtimeSinceStartup - startTime < TIMEOUT_FOR_MODULE_INSTALLATION)
Thread.Sleep(THREAD_SLEEP_TIME);


if (Time.realtimeSinceStartup - startTime >= TIMEOUT_FOR_MODULE_INSTALLATION)
{
Debug.LogError($"Package installation timed out for {identifier}. Please try again.");
}
if (addRequest.Error != null)
{
AssetDatabase.Refresh();
CompilationPipeline.RequestScriptCompilation();
SDKLogger.Log(TAG, "Error: " + addRequest.Error.message);
Debug.LogError("Error: " + addRequest.Error.message);
}
}

Expand Down
12 changes: 6 additions & 6 deletions Editor/Module Management/ModuleList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public static class ModuleList
{
name = "com.readyplayerme.core",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-core.git",
branch = "",
version = "1.2.0"
branch = "release/v1.3.0",
version = "1.3.0"
};

/// <summary>
Expand All @@ -33,15 +33,15 @@ public static class ModuleList
{
name = "com.readyplayerme.avatarloader",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-avatar-loader.git",
branch = "",
version = "1.2.0"
branch = "release/v1.3.0",
version = "1.3.0"
},
new ModuleInfo
{
name = "com.readyplayerme.webview",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-webview.git",
branch = "",
version = "1.1.0"
branch = "release/v1.2.0",
version = "1.2.0"
}
};

Expand Down
Loading

0 comments on commit 8d5b49d

Please sign in to comment.