Skip to content

Commit 9059db1

Browse files
committed
Initial commit
0 parents  commit 9059db1

35 files changed

+1062
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Unity (please complete the following information):**
27+
- Version: [e.g. 2020.3.29f1]
28+
- TestMode: [e.g. Editor, playmode]
29+
30+
**Desktop (please complete the following information):**
31+
- OS: [e.g. iOS]
32+
- Browser [e.g. chrome, safari]
33+
- Version [e.g. 22]
34+
35+
**Smartphone (please complete the following information):**
36+
- Device: [e.g. iPhone6]
37+
- OS: [e.g. iOS8.1]
38+
- Browser [e.g. stock browser, safari]
39+
- Version [e.g. 22]
40+
41+
**Additional context**
42+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Pull Request
3+
about: Create a pull request
4+
title: ''
5+
assignees:
6+
7+
---
8+
9+
**NOTE: Create a pull request to merge into `develop` branch**

.github/workflows/Release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release ▶️
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
# Prevent running on base template
11+
if: github.repository != 'OpenSourceUnityPackage/PackageTemplate'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
persist-credentials: false
17+
18+
- uses: cycjimmy/semantic-release-action@v3
19+
id: semantic # Need an `id` for output variables
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
extra_plugins: |
24+
@semantic-release/changelog
25+
@semantic-release/git
26+
27+
- name: Log version on published
28+
if: steps.semantic.outputs.new_release_published == 'true'
29+
run: |
30+
echo Version: ${{ steps.semantic.outputs.new_release_version }}
31+
echo Major: ${{ steps.semantic.outputs.new_release_major_version }}
32+
echo Minor: ${{ steps.semantic.outputs.new_release_minor_version }}
33+
echo Patch: ${{ steps.semantic.outputs.new_release_patch_version }}

.github/workflows/Test.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Run Tests 🧪
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
#- 'feature/**'
9+
pull_request:
10+
types:
11+
- opened
12+
- synchronize
13+
workflow_dispatch:
14+
15+
jobs:
16+
buildAndTestForSomePlatforms:
17+
# Prevent running on base template
18+
if: github.repository != 'OpenSourceUnityPackage/PackageTemplate'
19+
name: Test Unity version ${{ matrix.unityVersion }} | Platform ${{ matrix.targetPlatform }} | Test mode ${{ matrix.testMode }}
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
testMode:
25+
- playmode
26+
- editmode
27+
unityVersion:
28+
# Main LTS version : https://unity3d.com/unity/qa/lts-releases
29+
- 2019.4.38f1
30+
- 2020.3.33f1
31+
- 2021.3.1f1
32+
targetPlatform:
33+
# - StandaloneOSX # Build a macOS standalone (Intel 64-bit).
34+
- StandaloneWindows64 # Build a Windows 64-bit standalone.
35+
# - StandaloneLinux64 # Build a Linux 64-bit standalone.
36+
# - iOS # Build an iOS player.
37+
# - Android # Build an Android player.
38+
# - WebGL # WebGL.
39+
projectPath:
40+
- ./package/${{ github.repository }}
41+
42+
steps:
43+
# Checkout sandbox project
44+
- name: Checkout
45+
uses: actions/checkout@v3
46+
with:
47+
lfs: true
48+
49+
# Caching dependencies and build outputs to improve workflow execution time
50+
- uses: actions/cache@v3
51+
with:
52+
path: ${{ matrix.projectPath }}/Library
53+
key: Library-${{ matrix.projectPath }}
54+
restore-keys: |
55+
Library-
56+
57+
# Fix bug with test runner that canno't access to license if project is not into a directory
58+
- name: copy project into new directory
59+
run: |
60+
pwd
61+
folderName=$(echo "${PWD##*/}")
62+
rsync -r "$GITHUB_WORKSPACE" "package"
63+
ls -F "package/$folderName"
64+
65+
# Fail if sample is not call sample~ or sample.meta is found
66+
- name: Check sample folder
67+
run: |
68+
if [ -f ${{ matrix.projectPath }}/Sample.meta ];
69+
then
70+
echo "Sample.meta exist. Please remove it from your project"
71+
exit 1
72+
fi
73+
74+
if [ -d ${{ matrix.projectPath }}/Sample/ ];
75+
then
76+
echo "Sample.meta exist. Please ensure this folder is hiding for unity renaming it Sample~. Also ensure that meta Sample.meta doesn't exist"
77+
exit 1
78+
fi
79+
80+
echo "Sample folder ok"
81+
82+
# Run tests
83+
- name: "Run tests"
84+
uses: game-ci/unity-test-runner@main
85+
with:
86+
githubToken: ${{ secrets.GITHUB_TOKEN }}
87+
unityVersion: ${{ matrix.unityVersion }}
88+
projectPath: ${{ matrix.projectPath }}
89+
testMode: ${{ matrix.testMode }}
90+
packageMode: true
91+
# List of parameters here : https://docs.unity3d.com/Manual/CommandLineArguments.html
92+
customParameters: -nographics assemblyFilters:+[YourCompany].[YourPackageName].*,-*Tests*
93+
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport'
94+
env:
95+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
96+
97+
# Upload coverage
98+
- name: Upload coverage results
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: Package Coverage results (edit + play, ${{ matrix.unityVersion }}-${{ matrix.targetPlatform }}-${{ matrix.testMode }}
102+
path: ${{ steps.testRunner.outputs.coveragePath }}
103+
retention-days: 1

.github/workflows/setup.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Setup package 📝
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
Setup:
10+
# Prevent running on base template
11+
if: github.repository != 'OpenSourceUnityPackage/PackageTemplate'
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
# This need to respect the Unity nomenclature (see : https://docs.unity3d.com/Manual/cus-naming.html)
16+
# Previous name (back slash to include special character):
17+
PrevAuthorNameField: \[YourAuthorName\]
18+
PrevCompanyNameField: \[YourCompany\]
19+
PrevPackageNameField: \[YourPackageName\]
20+
PrevGitURLField: \[YourHTTPSGit\]
21+
PrevPackageDisplayNameField: \[YourPackageDisplayName\]
22+
# Your current settings :
23+
AuthorNameField: ${{github.repository_owner}}
24+
PackageNameField: ${{github.event.repository.name}}
25+
GitURLField: ${{github.server_url}}/${{github.repository}}.git
26+
27+
steps:
28+
###########################
29+
# Checkout #
30+
###########################
31+
- name: Checkout project
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0
35+
36+
##########################
37+
# Replace field #
38+
##########################
39+
- name: Replace name
40+
run: |
41+
echo ""
42+
echo "#########################"
43+
echo "# Replace field #"
44+
echo "#########################"
45+
echo ""
46+
echo ""
47+
48+
LowercaseProjectName="$(echo $PackageNameField | sed 's/[A-Z]/-&/g;s/^-//' | tr '[A-Z]' '[a-z]')"
49+
LowercaseCompanyNameField="$(echo $AuthorNameField | sed 's/[A-Z]/-&/g;s/^-//' | tr '[A-Z]' '[a-z]')"
50+
51+
find . -type f -name "*" ! -path "./.github/*" ! -path "./.git/*" ! -name ".gitignore" | while read FILE ; do
52+
sed -i -e "s/$PrevCompanyNameField/$LowercaseCompanyNameField/" -e "s/$PrevPackageNameField/$LowercaseProjectName/" ${FILE}
53+
newfile="$(echo ${FILE} |sed -e "s/$PrevCompanyNameField/$LowercaseCompanyNameField/" -e "s/$PrevPackageNameField/$LowercaseProjectName/")";
54+
if [ "${FILE}" != "${newfile}" ]; then
55+
echo "Rename ${FILE} to ${newfile}"
56+
mv "${FILE}" "${newfile}" ;
57+
fi
58+
done
59+
60+
echo "Set project display name: $PackageNameField"
61+
sed -i "s|$PrevPackageDisplayNameField|$PackageNameField|" package.json
62+
63+
echo "Set author : $AuthorNameField"
64+
sed -i "s|$PrevAuthorNameField|$AuthorNameField|" package.json
65+
66+
if [ "$AuthorNameField" == "OpenSourceUnityPackage" ]; then
67+
sed -i "s| \"url\"\: \"\"| \"url\"\: \"https:\/\/github.com\/OpenSourceUnityPackage\"|" package.json;
68+
fi
69+
70+
echo "Add repository URL: $GitURLField"
71+
sed -i "s|$PrevGitURLField|$GitURLField|" package.json
72+
73+
echo "Replace badge in reamde"
74+
sed -i -e "s/OpenSourceUnityPackage/$AuthorNameField/" -e "s/PackageTemplate/$PackageNameField/" README.md
75+
76+
################################
77+
# Remove setup action #
78+
################################
79+
- name: Remove setup action
80+
run: |
81+
rm .github/workflows/setup.yml
82+
83+
###########################
84+
# Commit #
85+
###########################
86+
- name: Commit files
87+
run: |
88+
git config --local user.email "[email protected]"
89+
git config --local user.name "GitHub Action"
90+
git add .
91+
git commit -m "Add changes"
92+
93+
#########################
94+
# Push #
95+
#########################
96+
- name: Push changes
97+
uses: ad-m/github-push-action@a3fd843e49cd58d296bdd2431c4853569a1b900f #Use specific commit for stability
98+
with:
99+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
# Visual Studio code cache directory
26+
.vscode/
27+
28+
# Rider cache directory
29+
.idea/
30+
31+
# Gradle cache directory
32+
.gradle/
33+
34+
# Autogenerated VS/MD/Consulo solution and project files
35+
ExportedObj/
36+
.consulo/
37+
*.csproj
38+
*.unityproj
39+
*.sln
40+
*.suo
41+
*.tmp
42+
*.user
43+
*.userprefs
44+
*.pidb
45+
*.booproj
46+
*.svd
47+
*.pdb
48+
*.mdb
49+
*.opendb
50+
*.VC.db
51+
52+
# Unity3D generated meta files
53+
*.pidb.meta
54+
*.pdb.meta
55+
*.mdb.meta
56+
57+
# Unity3D generated file on crash reports
58+
sysinfo.txt
59+
60+
# Builds
61+
*.apk
62+
*.unitypackage
63+
64+
# Crashlytics generated file
65+
crashlytics-build.properties
66+

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

CHANGELOG.md.meta

Lines changed: 7 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)