Skip to content

Commit

Permalink
kurone-kito/cumulative-updatesからプルリクエスト#12をマージする
Browse files Browse the repository at this point in the history
v0.8.0: Added the abstracted interval logic and cumulative updates
  • Loading branch information
kurone-kito authored Jul 20, 2024
2 parents dc7ed3f + 49303cd commit b495425
Show file tree
Hide file tree
Showing 27 changed files with 793 additions and 442 deletions.
2 changes: 2 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[core]
hideDotFiles = dotGitOnly
56 changes: 46 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,59 @@ jobs:
outputs:
config_package: ${{ steps.config_package.outputs.configPackage }}
steps:
- name: Ensure that required repository variable has been created for the Package
id: config_package
run: |
if [ "${{ vars.PACKAGE_NAME }}" != "" ]; then
echo "configPackage=true" >> $GITHUB_OUTPUT;
else
echo "configPackage=false" >> $GITHUB_OUTPUT;
fi
- name: Ensure that required repository variable has been created for the Package
id: config_package
run: |
if [ "${{ vars.PACKAGE_NAME }}" != "" ]; then
echo "configPackage=true" >> $GITHUB_OUTPUT;
else
echo "configPackage=false" >> $GITHUB_OUTPUT;
fi
build:
needs: config
runs-on: ubuntu-latest
permissions:
contents: write
env:
packagePath: Packages/${{ vars.PACKAGE_NAME }}
stableVersion:
unityPackage:
version:
zipFile:
if: needs.config.outputs.config_package == 'true'
steps:
- id: gpg
name: Import the GPG key
# cspell: disable-next-line
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
trust_level: 5
- name: Checkout Local Repository
uses: actions/checkout@v4
- name: copy the README and LICENSE files to the Package folder
run: cp README.md LICENSE "${{ env.packagePath }}"
- name: Get the Package version based on the package.json file
id: version
# cspell: disable-next-line
uses: sergeysova/jq-action@v2
with:
cmd: jq -r '.version' "${{ env.packagePath }}/package.json"
cmd: jq -r ".version" "${{ env.packagePath }}/package.json"
- name: Detect whether the version is a stable release
id: stable-match
# cspell: disable-next-line
uses: kaisugi/[email protected]
with:
flags: gm
regex: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
text: ${{ steps.version.outputs.value }}
- name: Configure the Environment Variables needed for releasing the Package
run: |
echo "zipFile=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}".zip >> $GITHUB_ENV
echo "stableVersion=${{ steps.stable-match.outputs.match }}" >> $GITHUB_ENV
echo "unityPackage=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}.unitypackage" >> $GITHUB_ENV
echo "version=${{ steps.version.outputs.value }}" >> $GITHUB_ENV
echo "zipFile=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}".zip >> $GITHUB_ENV
- name: Zip the Package for release
working-directory: "${{ env.packagePath }}"
run: zip -r -9 "${{ github.workspace }}/${{ env.zipFile }}" .
Expand All @@ -52,17 +74,31 @@ jobs:
include-files: metaList
- name: Zip the UnityPackage for release
run: zip -r -9 "${{ env.unityPackage }}.zip" ${{ env.unityPackage }} LICENSE README.md
- name: Sign the artifacts
run: |
echo "${GPG_PASSPHRASE}" | gpg --batch -ab "${{ env.zipFile }}"
echo "${GPG_PASSPHRASE}" | gpg --batch -ab "${{ env.unityPackage }}"
echo "${GPG_PASSPHRASE}" | gpg --batch -ab "${{ env.unityPackage }}.zip"
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Make a release tag of the version from the package.json file
id: tag_version
# cspell: disable-next-line
uses: rickstaa/action-create-tag@v1
with:
tag: "${{ env.version }}"
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Publish the Release to GitHub
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.zipFile }}
${{ env.zipFile }}.asc
${{ env.unityPackage }}
${{ env.unityPackage }}.asc
${{ env.unityPackage }}.zip
${{ env.unityPackage }}.zip.asc
${{ env.packagePath }}/package.json
prerelease: ${{ env.stableVersion == '' }}
tag_name: ${{ env.version }}
11 changes: 11 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ignores:
- .github/CODE_OF_CONDUCT*
- Assets
- Library
- Logs
- Packages/com*
- Packages/dev*
- Packages/dev*
- ProjectSettings
- Temp
- UserSettings
17 changes: 17 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
default: true
# Allow limit breakthroughs in the code block and table row lengths. The
# default is unconditional prohibition. It is exceptionally allowed in
# these elements due to folding difficulties.
line-length:
code_blocks: false
tables: false
# Allows the use of duplicate headings. The default is unconditional
# prohibition. Due to the `siblings_only` flag not working, it is necessary
# to enable duplicate headings in the entire document.
no-duplicate-heading: false
# Allows embedding of the specified HTML tag. The default is unconditional
# prohibition. Allow for some valuable features, such as folding.
no-inline-html:
allowed_elements:
- details
- summary
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet 6.0.422
dotnet 6.0.423
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"editorconfig.editorconfig",
"fernandoescolar.vscode-solution-explorer",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"visualstudiotoolsforunity.vstuc"
"visualstudiotoolsforunity.vstuc",
"zbecknell.t4-support"
]
}
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Unity",
"type": "vstuc",
"request": "attach"
"request": "attach",
"type": "vstuc"
}
]
],
"version": "0.2.0"
}
63 changes: 52 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,52 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"*": "${capture}.meta, ${capture}.md5",
"*.dll": "${capture}.pdb",
"*.md": "${capture}.*.md",
"*.sln": "*.csproj",
".markdownlint.*": ".markdownlint-cli2.*",
".gitconfig": ".gitattributes, .gitignore",
".tool-versions": "global.json",
"T.cs": "*.po"
},
"files.associations": {
"*.anim": "yaml",
"*.controller": "yaml",
"*.asmdef": "json",
"*.asmref": "json",
"*.asset": "yaml",
"*.buildreport": "yaml",
"*.config": "xml",
"*.controller": "yaml",
"*.dwlt": "yaml",
"*.info": "json",
"*.index": "json",
"*.inputactions": "json",
"*.lighting": "yaml",
"*.mat": "yaml",
"*.meta": "yaml",
"*.outputdata": "json",
"*.physicmaterial": "yaml",
"*.playable": "yaml",
"*.prefab": "yaml",
"*.renderTexture": "yaml",
"*.scenetemplate": "yaml",
"*.signal": "yaml",
"*.terrainlayer": "yaml",
"*.tlh": "c",
"*.traceevents": "jsonl",
"*.unity": "yaml",
"*.uss": "css",
".imgbotconfig": "json",
".manifest": "json",
"LICENSE": "plaintext"
".settings": "plist",
".signature": "json",
"LastSceneManagerSetup.txt": "yaml",
"LibraryFormatVersion.txt": "yaml",
"LICENSE": "plaintext",
"ProjectVersion.txt": "yaml",
"XRPackageSettings.asset": "json",
"XRSettings.asset": "json"
},
"files.readonlyInclude": {
"Packages/com.*/**": true,
Expand All @@ -29,12 +64,6 @@
"UserSettings/**": true
},
"git.branchProtection": ["main"],
"json.schemas": [
{
"fileMatch": ["docfx.json"],
"url": "https://json.schemastore.org/docfx.json"
}
],
"search.exclude": {
"**/*.suo": true,
"Build/": true,
Expand All @@ -54,6 +83,7 @@
"tag:unity3d.com,2011:20 mapping",
"tag:unity3d.com,2011:21 mapping",
"tag:unity3d.com,2011:23 mapping",
"tag:unity3d.com,2011:28 mapping",
"tag:unity3d.com,2011:29 mapping",
"tag:unity3d.com,2011:30 mapping",
"tag:unity3d.com,2011:33 mapping",
Expand All @@ -63,32 +93,43 @@
"tag:unity3d.com,2011:74 mapping",
"tag:unity3d.com,2011:78 mapping",
"tag:unity3d.com,2011:81 mapping",
"tag:unity3d.com,2011:82 mapping",
"tag:unity3d.com,2011:84 mapping",
"tag:unity3d.com,2011:91 mapping",
"tag:unity3d.com,2011:95 mapping",
"tag:unity3d.com,2011:104 mapping",
"tag:unity3d.com,2011:108 mapping",
"tag:unity3d.com,2011:114 mapping",
"tag:unity3d.com,2011:126 mapping",
"tag:unity3d.com,2011:129 mapping",
"tag:unity3d.com,2011:134 mapping",
"tag:unity3d.com,2011:157 mapping",
"tag:unity3d.com,2011:159 mapping",
"tag:unity3d.com,2011:162 mapping",
"tag:unity3d.com,2011:196 mapping",
"tag:unity3d.com,2011:222 mapping",
"tag:unity3d.com,2011:223 mapping",
"tag:unity3d.com,2011:224 mapping",
"tag:unity3d.com,2011:236 mapping",
"tag:unity3d.com,2011:310 mapping",
"tag:unity3d.com,2011:1001 mapping",
"tag:unity3d.com,2011:1002 mapping",
"tag:unity3d.com,2011:1045 mapping",
"tag:unity3d.com,2011:1101 mapping",
"tag:unity3d.com,2011:1102 mapping",
"tag:unity3d.com,2011:1107 mapping",
"tag:unity3d.com,2011:1125 mapping",
"tag:unity3d.com,2011:1126 mapping",
"tag:unity3d.com,2011:382020655 mapping",
"tag:unity3d.com,2011:387306366 mapping",
"tag:unity3d.com,2011:641289076 mapping",
"tag:unity3d.com,2011:668709126 mapping",
"tag:unity3d.com,2011:850595691 mapping",
"tag:unity3d.com,2011:890905787 mapping",
"tag:unity3d.com,2011:937362698 mapping",
"tag:unity3d.com,2011:1386491679 mapping",
"tag:unity3d.com,2011:1660057539 mapping"
"tag:unity3d.com,2011:1521398425 mapping",
"tag:unity3d.com,2011:1660057539 mapping",
"tag:unity3d.com,2011:1953259897 mapping"
],
"yaml.schemas": {
"https://coderabbit.ai/integrations/coderabbit-overrides.v2.json": [
Expand Down
10 changes: 5 additions & 5 deletions Documentation/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############
# temp file #
###############
*.yml
.manifest
###############
# temp file #
###############
*.yml
.manifest
4 changes: 2 additions & 2 deletions Documentation/articles/toc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- name: Introduction
href: intro.md
- name: Introduction
href: intro.md
3 changes: 1 addition & 2 deletions Packages/black.kit.toybox/Examples/Scripts/Nameplate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using UdonSharp;
using UdonSharp;
using UnityEngine.UI;
using VRC.SDKBase;

Expand Down
3 changes: 1 addition & 2 deletions Packages/black.kit.toybox/Examples/Scripts/ToggleHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using UdonSharp;
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using UdonSharp;
using UdonSharp;
using UnityEngine;

namespace black.kit.toybox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using UdonSharp;
using UdonSharp;
using UnityEngine;

namespace black.kit.toybox
Expand Down
52 changes: 52 additions & 0 deletions Packages/black.kit.toybox/Runtime/Scripts/UI/IntervalBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using UdonSharp;
using UnityEngine;

namespace black.kit.toybox
{
/// <summary>The base class of the interval logic.</summary>
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public abstract class IntervalBase : UdonSharpBehaviour
{
/// <summary>The safe minimum interval.</summary>
private const float SAFE_MIN_INTERVAL = 0.01f;

/// <summary>The warning of the null.</summary>
private const string WARN_NULL = "Some inspector values is null.";

/// <summary>The interval of the progress.</summary>
/// <remarks>It ignores less than 0.01f.</remarks>
[SerializeField, Range(SAFE_MIN_INTERVAL, 60f)]
[Tooltip("Specifies the interval of the progress")]
private float interval = 1f;

/// <summary>The interval of the progress.</summary>
public float Interval => interval;

/// <summary>Update the view of the UI.</summary>
public void InternalUpdateView()
{
UpdateView();
var safeInterval = Mathf.Max(Interval, SAFE_MIN_INTERVAL);
SendCustomEventDelayedSeconds(nameof(InternalUpdateView), safeInterval);
}

/// <summary>Update the view of the UI.</summary>
[ContextMenu("Update view")]
public abstract void UpdateView();

/// <summary>Validate the inspector.</summary>
/// <returns>Whether the inspectors are valid.</returns>
protected abstract bool ValidateInspector();

/// <summary>The callback when the object is initialized.</summary>
protected virtual void Start()
{
if (!ValidateInspector())
{
Debug.LogWarning(WARN_NULL);
return;
}
SendCustomEventDelayedFrames(nameof(InternalUpdateView), 1);
}
}
}
11 changes: 11 additions & 0 deletions Packages/black.kit.toybox/Runtime/Scripts/UI/IntervalBase.cs.meta

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

Loading

0 comments on commit b495425

Please sign in to comment.