Skip to content

Commit 48b2c72

Browse files
authored
Merge pull request #2 from VRLabs/dev
Cleanup
2 parents 921c3d8 + 6bb1434 commit 48b2c72

File tree

93 files changed

+2726
-3720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2726
-3720
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: VRC Asset Release and Listing Upload
2+
on:
3+
push:
4+
tags:
5+
- "*.*.*"
6+
7+
env:
8+
ASSETS_PATH: .
9+
RELEASE_PATH: Packages
10+
ARTIFACT_DURATION: 30 # In days
11+
UPLOAD_ENDPOINT: https://api.vrlabs.dev/packages/add
12+
WORKFLOW_VERSION: 1.0.0
13+
14+
jobs:
15+
build:
16+
runs-on: "ubuntu-latest"
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Check if package.json exists
22+
run: |
23+
if [ ! -f package.json ]; then
24+
echo "package.json not found"
25+
exit 1
26+
fi
27+
28+
- name: Get package.json
29+
id: get_package_json
30+
run: |
31+
{
32+
echo 'package_json<<"""'
33+
echo $(cat package.json)
34+
echo '"""'
35+
} >> $GITHUB_OUTPUT
36+
37+
- name: Get needed Data
38+
id: job_data
39+
run: |
40+
version=$(echo "${{ github.ref_name }}")
41+
version=$(echo $version | tr '[:upper:]' '[:lower:]')
42+
echo "version=$version" >> $GITHUB_OUTPUT
43+
major_version=$(echo $version | cut -d '.' -f 1)
44+
minor_version=$(echo $version | cut -d '.' -f 2)
45+
echo "major_version=$major_version" >> $GITHUB_OUTPUT
46+
echo "minor_version=$minor_version" >> $GITHUB_OUTPUT
47+
name="${{ fromJson(steps.get_package_json.outputs.package_json).name }}"
48+
display_name="${{ fromJson(steps.get_package_json.outputs.package_json).displayName }}"
49+
echo "package_name=$name" >> $GITHUB_OUTPUT
50+
echo "package_display_name=$display_name" >> $GITHUB_OUTPUT
51+
52+
- name: Create Packages
53+
id: create_packages
54+
uses: VRLabs/VRCTools-Packaging-Action@v1
55+
with:
56+
path: '${{ env.ASSETS_PATH }}'
57+
outputPath: '${{ env.RELEASE_PATH }}'
58+
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'
59+
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'
60+
releaseVersion: '${{ steps.job_data.outputs.version }}'
61+
62+
- name: Create Release
63+
uses: softprops/action-gh-release@v1
64+
if: startsWith(github.ref, 'refs/tags/')
65+
with:
66+
name: "${{ steps.job_data.outputs.package_display_name }} ${{ steps.job_data.outputs.version }}"
67+
files: |
68+
${{ steps.create_packages.outputs.unityPackagePath }}
69+
${{ steps.create_packages.outputs.vccPackagePath }}
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
SOURCE_TAG: ${{ steps.job_data.outputs.version }}
73+
74+
- name: Add server-json to Artifacts
75+
uses: actions/upload-artifact@v3
76+
with:
77+
name: server-json
78+
path: ${{ steps.create_packages.outputs.serverPackageJsonPath }}
79+
retention-days: ${{ env.ARTIFACT_DURATION }}
80+
81+
- name: Send package info to a server
82+
run: |
83+
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
84+
shell: bash

.github/workflows/create-release.yml

-45
This file was deleted.

Instancer.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "VRLabs Weapon-Slash Instancer",
3+
"rootNamespace": "",
4+
"references": [],
5+
"includePlatforms": [
6+
"Editor"
7+
],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": false,
11+
"precompiledReferences": [],
12+
"autoReferenced": true,
13+
"defineConstraints": [],
14+
"versionDefines": [
15+
{
16+
"name": "dev.vrlabs.instancer",
17+
"expression": "",
18+
"define": "VRLABS_INSTANCER_FOUND"
19+
}
20+
],
21+
"noEngineReferences": false
22+
}

Instancer/Weapon-Slash Instancer.asmdef.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Instancer/Weapon-Slash Instancer.cs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#if VRLABS_INSTANCER_FOUND
2+
using System;
3+
using System.Linq;
4+
using System.Reflection;
5+
using UnityEditor;
6+
using UnityEngine;
7+
8+
namespace VRLabs.WeaponSlash
9+
{
10+
public class WeaponSlash : ScriptableObject
11+
{
12+
public const string packageName = "Weapon-Slash";
13+
14+
public static string[] excludeRegexs =
15+
{
16+
".*\\.cs",
17+
".*\\.asmdef",
18+
"package.json"
19+
};
20+
21+
[MenuItem("VRLabs/Create Instance/Weapon Slash")]
22+
public static void FancyPackage()
23+
{
24+
Type instancerType = AppDomain.CurrentDomain.GetAssemblies()
25+
.Where(x => x.GetType("VRLabs.Instancer.Instancer") != null)
26+
.Select(x => x.GetType("VRLabs.Instancer.Instancer")).FirstOrDefault();
27+
28+
if (instancerType == null)
29+
{
30+
Debug.LogError("Instancer not found. To use this functionality, install the VRLabs Instancer from https://github.com/VRLabs/Instancer");
31+
return;
32+
}
33+
34+
MethodInfo instanceMethod = instancerType.GetMethod("Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
35+
36+
if (instanceMethod == null)
37+
{
38+
Debug.LogError("Instance method not found");
39+
return;
40+
}
41+
42+
var editor = ScriptableObject.CreateInstance<WeaponSlash>();
43+
var script = MonoScript.FromScriptableObject(editor);
44+
var assetPath = AssetDatabase.GetAssetPath(script);
45+
46+
instanceMethod.Invoke(null, new object[] { packageName, assetPath, excludeRegexs });
47+
}
48+
}
49+
}
50+
#endif

Instancer/Weapon-Slash Instancer.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 VRLabs
3+
Copyright (c) 2022 VRLabs LLC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Media/Preview.gif

8.94 MB
Loading

Media/Preview.png

264 KB
Loading

Media/Setup.mp4

-1.2 MB
Binary file not shown.

Media/Web/Preview.webp

3.53 KB
Binary file not shown.

Media/Web/Preview.webp.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Media/Web/PreviewGif.webp

256 KB
Binary file not shown.

Media/Web/PreviewGif.webp.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)