diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..5b2f78dff --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,137 @@ +name: CI + +on: + push: + paths-ignore: + - 'Documentation/**' + - '*.md' + +jobs: + + #enable this job to request a manual unity license + Request-License: + runs-on: ubuntu-latest + if: false + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Request manual activation file + uses: MirrorNG/unity-runner@master + with: + entrypoint: /request_activation.sh + + # This will produce a Unity_xxx.alf file + # download it in your computer and upload it to + # https://license.unity3d.com/manual + # That will produce a Unity_xxx.ulf file + # add the contents of Unity_xxx.ulf file to your repository's secrets + # as UNITY_LICENSE + # then disable this job + - name: Expose as artifact + uses: actions/upload-artifact@v1 + with: + name: Manual Activation File + path: ${{ steps.getManualLicenseFile.outputs.filePath }} + + + Zenject-usage: + runs-on: [windows-latest] + name: Zenject-usage + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup MSBuild.exe + uses: warrenbuckley/Setup-MSBuild@v1 + + - name: MSBuild + working-directory: AssemblyBuild\Zenject-usage + run: msbuild Zenject-usage.sln + + - name: Upload dll + uses: actions/upload-artifact@v1 + with: + name: Zenject-usage + path: AssemblyBuild\Zenject-usage\bin\Debug\ + + buildUnity: + name: Unity test + runs-on: ubuntu-latest + needs: Zenject-usage + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + steps: + + # Checkout repository (required to test local actions) + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Download Zenject-usage + uses: actions/download-artifact@v1 + with: + name: Zenject-usage + + - name: Install Zenject-usage + run: | + ls -l Zenject-usage + cp Zenject-usage/Zenject-usage.dll UnityProject/Assets/Plugins/Zenject/Source/Usage + ls -l UnityProject/Assets/Plugins/Zenject/Source/Usage + +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v1 +# with: +# python-version: "3.8" + +# - name: Install filter-repo +# run: pip3 install git-filter-repo + + - name: Activate license + uses: MirrorNG/unity-runner@master + with: + entrypoint: /activate.sh + + # Configure test runner + - name: Run editor Tests + uses: MirrorNG/unity-runner@master + with: + args: -projectPath UnityProject -runTests -testPlatform editmode -testResults Tests/editmode-results.xml -enableCodeCoverage -coverageResultsPath Tests + + # Upload artifacts + - name: Publish test results + uses: actions/upload-artifact@v1 + with: + name: Test results (editor mode) + path: UnityProject/Tests/editmode-results.xml + +# - name: Generate Solution +# uses: MirrorNG/unity-runner@master +# with: +# # Arguments to pass to unity +# args: -buildTarget StandaloneWindows64 -customBuildName MirrorNG -customBuildPath ./build/StandaloneWindows64 -projectPath . -executeMethod UnityEditor.SyncVS.SyncSolution -quit + +# - name: SonarQube analysis +# uses: MirrorNG/unity-sonarscanner@master +# with: +# buildCommand: /opt/Unity/Editor/Data/NetCore/Sdk-2.2.107/dotnet build workspace.sln +# projectKey: MirrorNG_MirrorNG +# projectName: MirrorNG +# sonarOrganisation: mirrorng +# beginArguments: /d:sonar.verbose="true" /d:sonar.cs.nunit.reportsPaths=Tests/editmode-results.xml /d:sonar.cs.opencover.reportsPaths=Tests/workspace-opencov/EditMode/TestCoverageResults_0000.xml +# env: +# FrameworkPathOverride: /opt/Unity/Editor/Data/MonoBleedingEdge/ +# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release + uses: cycjimmy/semantic-release-action@v2 + with: + extra_plugins: | + @semantic-release/exec + @semantic-release/changelog + @semantic-release/git + branch: master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 000000000..91fc55e48 --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,27 @@ +{ + "plugins": [ + "@semantic-release/github", + "@semantic-release/release-notes-generator", + ["@semantic-release/commit-analyzer", { + "preset": "angular", + "releaseRules": [ + {"type": "breaking", "release": "major"}, + {"type": "feature", "release": "minor"}, + ] + }], + ["@semantic-release/changelog", { + "changelogFile": "UnityProject/Assets/Plugins/Zenject/CHANGELOG.md", + }], + ["@semantic-release/npm", { + "npmPublish": false, + "pkgRoot": "UnityProject/Assets/Plugins/Zenject" + }], + ["@semantic-release/git", { + "assets": ["UnityProject/Assets/Plugins/Zenject/package.json", "UnityProject/Assets/Plugins/Zenject/CHANGELOG.md"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + }] +# ["@semantic-release/exec", { +# "publishCmd": "./publish_upm.sh upm ${nextRelease.version}" +# }] + ] +} diff --git a/UnityProject/Assets/Plugins/Zenject/package.json b/UnityProject/Assets/Plugins/Zenject/package.json new file mode 100644 index 000000000..fc072d4fa --- /dev/null +++ b/UnityProject/Assets/Plugins/Zenject/package.json @@ -0,0 +1,8 @@ + +{ + "name": "com.svermeulen.extenject", + "displayName": "Extenject", + "version": "0.0.1", + "description": "Dependency Injection Framework for Unity3D", + "dependencies": {} +} diff --git a/UnityProject/Assets/Plugins/Zenject/package.json.meta b/UnityProject/Assets/Plugins/Zenject/package.json.meta new file mode 100644 index 000000000..8063b9771 --- /dev/null +++ b/UnityProject/Assets/Plugins/Zenject/package.json.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5ee7f1788474bd44a48b0a201461151 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +