-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from VRLabs/feature/vcc-support
vcc support
- Loading branch information
Showing
13 changed files
with
228 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: VRC Asset Release and Listing Upload | ||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
env: | ||
ASSETS_PATH: . | ||
RELEASE_PATH: Packages | ||
ARTIFACT_DURATION: 30 # In days | ||
UPLOAD_ENDPOINT: https://api.vrlabs.dev/packages/add | ||
WORKFLOW_VERSION: 1.0.0 | ||
|
||
jobs: | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check if package.json exists | ||
run: | | ||
if [ ! -f package.json ]; then | ||
echo "package.json not found" | ||
exit 1 | ||
fi | ||
- name: Get package.json | ||
id: get_package_json | ||
run: | | ||
{ | ||
echo 'package_json<<"""' | ||
echo $(cat package.json) | ||
echo '"""' | ||
} >> $GITHUB_OUTPUT | ||
- name: Get needed Data | ||
id: job_data | ||
run: | | ||
version=$(echo "${{ github.ref_name }}") | ||
version=$(echo $version | tr '[:upper:]' '[:lower:]') | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
major_version=$(echo $version | cut -d '.' -f 1) | ||
minor_version=$(echo $version | cut -d '.' -f 2) | ||
echo "major_version=$major_version" >> $GITHUB_OUTPUT | ||
echo "minor_version=$minor_version" >> $GITHUB_OUTPUT | ||
name="${{ fromJson(steps.get_package_json.outputs.package_json).name }}" | ||
display_name="${{ fromJson(steps.get_package_json.outputs.package_json).displayName }}" | ||
echo "package_name=$name" >> $GITHUB_OUTPUT | ||
echo "package_display_name=$display_name" >> $GITHUB_OUTPUT | ||
- name: Create Packages | ||
id: create_packages | ||
uses: VRLabs/VRCTools-Packaging-Action@v1 | ||
with: | ||
path: '${{ env.ASSETS_PATH }}' | ||
outputPath: '${{ env.RELEASE_PATH }}' | ||
releaseUrl: 'https://github.com/${{ github.repository }}/releases/download/${{ steps.job_data.outputs.version }}/${{ steps.job_data.outputs.package_name }}-${{ steps.job_data.outputs.version }}.zip' | ||
unityReleaseUrl: 'https://github.com/${{ github.repository }}/releases/download/${{ steps.job_data.outputs.version }}/${{ steps.job_data.outputs.package_name }}-${{ steps.job_data.outputs.version }}.unitypackage' | ||
releaseVersion: '${{ steps.job_data.outputs.version }}' | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
name: "${{ steps.job_data.outputs.package_display_name }} ${{ steps.job_data.outputs.version }}" | ||
files: | | ||
${{ steps.create_packages.outputs.unityPackagePath }} | ||
${{ steps.create_packages.outputs.vccPackagePath }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SOURCE_TAG: ${{ steps.job_data.outputs.version }} | ||
|
||
- name: Add server-json to Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: server-json | ||
path: ${{ steps.create_packages.outputs.serverPackageJsonPath }} | ||
retention-days: ${{ env.ARTIFACT_DURATION }} | ||
|
||
- name: Send package info to a server | ||
run: | | ||
curl -X POST -H "Content-Type: application/json" -H "Vrl-Api-Key: ${{ secrets.LISTINGS_API_KEY }}" --data @${{ steps.create_packages.outputs.serverPackageJsonPath }} ${{ env.UPLOAD_ENDPOINT }} || exit 0 | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "VRLabs Local-Mirror-Detection Instancer", | ||
"rootNamespace": "", | ||
"references": [], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [ | ||
{ | ||
"name": "dev.vrlabs.instancer", | ||
"expression": "", | ||
"define": "VRLABS_INSTANCER_FOUND" | ||
} | ||
], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#if VRLABS_INSTANCER_FOUND | ||
using System; | ||
using System.Linq; | ||
using System.Reflection; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace VRLabs.LocalMirrorDetection | ||
{ | ||
public class LocalMirrorDetection : ScriptableObject | ||
{ | ||
public const string packageName = "Local-Mirror-Detection"; | ||
|
||
public static string[] excludeRegexs = | ||
{ | ||
".*\\.cs", | ||
".*\\.asmdef", | ||
"package.json" | ||
}; | ||
|
||
[MenuItem("VRLabs/Create Instance/Local Mirror Detection")] | ||
public static void FancyPackage() | ||
{ | ||
Type instancerType = AppDomain.CurrentDomain.GetAssemblies() | ||
.Where(x => x.GetType("VRLabs.Instancer.Instancer") != null) | ||
.Select(x => x.GetType("VRLabs.Instancer.Instancer")).FirstOrDefault(); | ||
|
||
if (instancerType == null) | ||
{ | ||
Debug.LogError("Instancer not found. To use this functionality, install the VRLabs Instancer from https://github.com/VRLabs/Instancer"); | ||
return; | ||
} | ||
|
||
MethodInfo instanceMethod = instancerType.GetMethod("Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); | ||
|
||
if (instanceMethod == null) | ||
{ | ||
Debug.LogError("Instance method not found"); | ||
return; | ||
} | ||
|
||
var editor = ScriptableObject.CreateInstance<LocalMirrorDetection>(); | ||
var script = MonoScript.FromScriptableObject(editor); | ||
var assetPath = AssetDatabase.GetAssetPath(script); | ||
|
||
instanceMethod.Invoke(null, new object[] { packageName, assetPath, excludeRegexs }); | ||
} | ||
} | ||
} | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "dev.vrlabs.local-mirror-detection", | ||
"displayName": "Local Mirror Detection", | ||
"version": "1.0.999", | ||
"license": "MIT", | ||
"unity": "2019.4", | ||
"description": "Sets an \"IsMirror\" parameter to true on your mirror clone", | ||
"author": { | ||
"name": "VRLabs", | ||
"email": "[email protected]", | ||
"url": "https://vrlabs.dev" | ||
}, | ||
"siteUrl": "https://github.com/VRLabs/Local-Mirror-Detection", | ||
"vpmDependencies": { | ||
"dev.vrlabs.instancer": "1.x" | ||
}, | ||
"legacyFolders": { | ||
"Assets\\VRLabs\\Local Mirror Detection": "752b7e9b073124232a11f12753e8d120" | ||
}, | ||
"unityPackageDestinationFolder": "Assets/VRLabs/Local Mirror Detection", | ||
"vccRepoCategory": "components", | ||
"media": { | ||
"previewImage": "https://raw.githubusercontent.com/VRLabs/Local-Mirror-Detection/main/Media/Web/Preview.webp", | ||
"previewGif": "https://raw.githubusercontent.com/VRLabs/Local-Mirror-Detection/main/Media/Web/Preview.webp" | ||
}, | ||
"unityPackageDestinationFolderMetas": { | ||
"Assets/VRLabs": "652a1ba5b00554143bc9a76307dbc4e8", | ||
"Assets/VRLabs/Local Mirror Detection": "752b7e9b073124232a11f12753e8d120" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.