Skip to content

Commit 6ff6ed4

Browse files
committed
First Commit
1 parent 54c0814 commit 6ff6ed4

32 files changed

+1930
-0
lines changed

.github/thumbnail.png

1.89 KB
Loading

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Build Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: main
7+
paths: package.json
8+
9+
env:
10+
packageName: "ru.coderco.animationpatches"
11+
packagePath: "Packages/ru.coderco.animationpatches"
12+
packageFileName: "AnimationPatches"
13+
packageReleaseName: "AnimationPatches"
14+
triggerRepoUpdate: ${{ false }}
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Get Version
28+
id: version
29+
uses: zoexx/github-action-json-file-properties@b9f36ce6ee6fe2680cd3c32b2c62e22eade7e590
30+
with:
31+
file_path: "./package.json"
32+
prop_path: "version"
33+
34+
- name: Generate Tag
35+
id: tag
36+
run: echo prop="v${{ steps.version.outputs.value }}" >> $GITHUB_OUTPUT
37+
38+
- name: Check If Release Tag Exists
39+
id: checkReleaseTag
40+
uses: mukunku/tag-exists-action@v1.2.0
41+
with:
42+
tag: ${{ steps.tag.outputs.prop }}
43+
44+
- name: Set Environment Variables
45+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
46+
run: |
47+
echo "zipFile=${{ env.packageFileName }}_v${{ steps.version.outputs.value }}".zip >> $GITHUB_ENV
48+
echo "unityPackage=${{ env.packageFileName }}_v${{ steps.version.outputs.value }}.unitypackage" >> $GITHUB_ENV
49+
50+
- name: Create directory and move files
51+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
52+
run: |
53+
mkdir -p ${{env.packagePath}}
54+
rsync -r --exclude="${{ env.packagePath }}" ./ "${{ env.packagePath }}"/
55+
56+
- name: Create Zip
57+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
58+
uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657
59+
with:
60+
type: "zip"
61+
directory: "${{env.packagePath}}/"
62+
filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above
63+
exclusions: "*.git* *.github* .gitignore Packages/"
64+
65+
- run: find "${{env.packagePath}}" -name \*.meta >> metaList
66+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
67+
68+
- name: Create UnityPackage
69+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
70+
uses: pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b
71+
with:
72+
package-path: ${{ env.unityPackage }}
73+
include-files: metaList
74+
75+
- name: Add Icon to UnityPackage
76+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
77+
uses: foxscore/add-icon-to-unitypackage@v1
78+
with:
79+
package_path: ${{ env.unityPackage }}
80+
icon_path: '.github/thumbnail.png'
81+
package_not_found_behavior: 'warn'
82+
icon_not_found_behavior: 'warn'
83+
icon_already_present_behavior: 'warn'
84+
85+
- name: Make Release
86+
if: ${{ steps.checkReleaseTag.outputs.exists == 'false' }}
87+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
88+
with:
89+
name: "${{ env.packageReleaseName }} v${{ steps.version.outputs.value }}"
90+
tag_name: "v${{ steps.version.outputs.value }}"
91+
files: |
92+
${{ env.zipFile }}
93+
${{ env.unityPackage }}
94+
./package.json
95+
96+
- name: Trigger VPM Repo Listing Update
97+
if: ${{ env.triggerRepoUpdate == 'true' && steps.checkReleaseTag.outputs.exists == 'false'}}
98+
uses: peter-evans/repository-dispatch@v2
99+
with:
100+
event-type: trigger-repo-update
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Trigger Repo Update
2+
3+
on:
4+
release:
5+
types: [published, unpublished, created, edited, deleted]
6+
repository_dispatch:
7+
types:
8+
- trigger-repo-update
9+
workflow_dispatch:
10+
11+
env:
12+
triggerUpdate: ${{ false }}
13+
repoOwner: "JustSleightly"
14+
repoName: "VPM-Package-Listing-Template"
15+
repoBranch: "main"
16+
workflowName: "build-listing.yml"
17+
accessToken: ${{ secrets.VPM_TOKEN }}
18+
19+
jobs:
20+
dispatch:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Trigger Repo Update
24+
if: ${{ env.triggerUpdate == 'true' }}
25+
uses: actions/github-script@v6
26+
with:
27+
github-token: ${{ env.accessToken }}
28+
script: |
29+
await github.rest.actions.createWorkflowDispatch({
30+
owner: '${{ env.repoOwner }}',
31+
repo: '${{ env.repoName }}',
32+
workflow_id: '${{ env.workflowName }}',
33+
ref: '${{ env.repoBranch }}',
34+
})
35+
36+
# thanks to bd_, modified from this action: https://github.com/bdunderscore/modular-avatar/blob/main/.github/workflows/trigger-repo-rebuild.yml

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This .gitignore file should be placed at the root of your Unity project directory
2+
#
3+
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4+
#
5+
/[Ll]ibrary/
6+
/[Tt]emp/
7+
/[Oo]bj/
8+
/[Bb]uild/
9+
/[Bb]uilds/
10+
/[Ll]ogs/
11+
/[Mm]emoryCaptures/
12+
13+
# Asset meta data should only be ignored when the corresponding asset is also ignored
14+
!/[Aa]ssets/**/*.meta
15+
16+
# Uncomment this line if you wish to ignore the asset store tools plugin
17+
# /[Aa]ssets/AssetStoreTools*
18+
19+
# Autogenerated Jetbrains Rider plugin
20+
[Aa]ssets/Plugins/Editor/JetBrains*
21+
22+
# Visual Studio cache directory
23+
.vs/
24+
25+
# Gradle cache directory
26+
.gradle/
27+
28+
# Autogenerated VS/MD/Consulo solution and project files
29+
ExportedObj/
30+
.consulo/
31+
*.csproj
32+
*.unityproj
33+
*.sln
34+
*.suo
35+
*.tmp
36+
*.user
37+
*.userprefs
38+
*.pidb
39+
*.booproj
40+
*.svd
41+
*.pdb
42+
*.mdb
43+
*.opendb
44+
*.VC.db
45+
46+
# Unity3D generated meta files
47+
*.pidb.meta
48+
*.pdb.meta
49+
*.mdb.meta
50+
51+
# Unity3D generated file on crash reports
52+
sysinfo.txt
53+
54+
# Builds
55+
*.apk
56+
*.unitypackage
57+
58+
# Crashlytics generated file
59+
crashlytics-build.properties

Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/Core.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using HarmonyLib;
2+
using UnityEditor;
3+
4+
namespace CoderScripts.MeshEditorPlus
5+
{
6+
[InitializeOnLoad]
7+
public class Core
8+
{
9+
private static int wait = 0;
10+
11+
static Core()
12+
{
13+
EditorApplication.update -= DoPatches;
14+
EditorApplication.update += DoPatches;
15+
}
16+
17+
public static Harmony harmonyInstance = new Harmony("CoderScripts.MeshEditorPlus");
18+
19+
static void DoPatches()
20+
{
21+
wait++;
22+
if (wait > 2)
23+
{
24+
EditorApplication.update -= DoPatches;
25+
harmonyInstance.PatchAll();
26+
}
27+
}
28+
}
29+
}

Editor/Core.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)