Skip to content

Commit

Permalink
feat: first
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Jun 26, 2024
1 parent 4eb4203 commit b32f389
Show file tree
Hide file tree
Showing 140 changed files with 31,391 additions and 6 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

csharp_style_namespace_declarations = block_scoped
csharp_style_implicit_object_creation_when_type_is_apparent = false
resharper_object_creation_when_type_evident = explicitly_typed

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 🚀 Deploy with Zip

on:
workflow_dispatch:
inputs:
zip:
description: 'The url to the zip file'
required: true

jobs:
deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: 📦 Download zip file To '_site'
run: |
curl -L ${{ github.event.inputs.zip }} -o _site.zip
unzip _site.zip -d _site
find _site -name __MACOSX -exec rm -rf {} \;
- name: 📦 Upload '_site'
uses: actions/upload-pages-artifact@v2

- name: 🚀 Deploy To GitHub Pages
uses: actions/deploy-pages@v2
39 changes: 39 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 🔀 Merge

on:
workflow_dispatch:
inputs:
from:
required: true
to:
required: true
workflow_call:
inputs:
from:
required: true
type: string
to:
required: true
type: string

jobs:
merge:
name: 🔀 Merge
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🚚 Checkout (${{ inputs.to }})
uses: actions/checkout@v4
with:
ref: ${{ inputs.to }}
fetch-depth: 0

- name: 🔀 Merge '${{ inputs.from }}' into '${{ inputs.to }}'
continue-on-error: true
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git merge ${{ inputs.from }}
git push origin ${{ inputs.to }}
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 🔖 Release

on:
workflow_dispatch:
push:
branches:
- preview
- main
- v*.x
tags-ignore:
- "**"

jobs:
release:
name: 🔖 Release (${{ github.ref_name }})
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
outputs:
channel: ${{ steps.release.outputs.new_release_channel }}
released: ${{ steps.release.outputs.new_release_published }}
tag: ${{ steps.release.outputs.new_release_git_tag }}
steps:
- name: 🚚 Checkout (${{ github.ref_name }})
uses: actions/checkout@v4

- name: 🔖 Run semantic release
uses: cycjimmy/semantic-release-action@v3
id: release
with:
working_directory: Packages/src
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ github.token }}

- run: |
echo "🔖 New release published: '${{ steps.release.outputs.new_release_published }}'" | tee -a $GITHUB_STEP_SUMMARY
echo "🔖 New release channel: '${{ steps.release.outputs.new_release_channel }}'" | tee -a $GITHUB_STEP_SUMMARY
echo "🔖 New release git tag: '${{ steps.release.outputs.new_release_git_tag }}'" | tee -a $GITHUB_STEP_SUMMARY
merge-to-develop:
name: 🔀 Merge to develop
needs: release
if: needs.release.outputs.released == 'true' && needs.release.outputs.channel == ''
uses: ./.github/workflows/merge.yml
with:
from: ${{ needs.release.outputs.tag }}
to: develop
permissions:
contents: write
94 changes: 94 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Required secrets
# UNITY_LICENSE: The contents of Unity license file
# UNITY_EMAIL: Unity user email to login
# UNITY_PASSWORD: Unity user password to login
name: 🧪 Test

env:
# MINIMUM_VERSION: The minimum version of Unity.
MINIMUM_VERSION: 2019.4
# EXCLUDE_FILTER: The excluded versions of Unity.
EXCLUDE_FILTER: '(2020.2.0)'

on:
workflow_dispatch:
push:
branches:
- develop
- develop-preview
tags:
- "!*"
paths-ignore:
- "*.md"
pull_request:
types:
- opened
- synchronize

jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
outputs:
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- name: ⚙️ Find target Unity versions
id: setup
run: |
echo "==== Target Unity Versions ===="
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
# ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
ADDITIONAL_VERSIONS=[]
VERSIONS=`echo "[${LATEST_VERSIONS}, ${ADDITIONAL_VERSIONS}]" \
| jq -c '[ flatten | sort | unique | .[] | select( test("${{ env.EXCLUDE_FILTER }}") | not ) ]'`
echo "unityVersions=${VERSIONS}" | tee $GITHUB_OUTPUT
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
permissions:
checks: write
contents: read
needs: setup
strategy:
fail-fast: false
max-parallel: 4
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout
uses: actions/checkout@v4

- name: 📥 Cache library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
restore-keys: |
Library-${{ matrix.unityVersion }}-
Library-
- name: 🛠️ Build Unity Project
uses: game-ci/unity-builder@v4
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
targetPlatform: StandaloneLinux64
allowDirtyBuild: true
customParameters: -nographics

- name: 🧪 Run tests
uses: game-ci/unity-test-runner@v4
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
# unityVersion: ${{ matrix.unityVersion }}
customParameters: -nographics
checkName: ${{ matrix.unityVersion }} Test Results
githubToken: ${{ github.token }}
coverageOptions: "dontClear;generateHtmlReport;generateBadgeReport;pathFilters:+**/Packages/src/**;assemblyFilters:+<packages>,-*.Editor,-*.Test"
8 changes: 8 additions & 0 deletions Assets/Demo.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Demo/AllocTest.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Assets/Demo/AllocTest/AllocTest.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "AllocTest",
"rootNamespace": "",
"references": [
"GUID:c7a163cf79fa14611a165dc6fc8bce88",
"GUID:1dfa9376c09b544718e27517295387d4"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Assets/Demo/AllocTest/AllocTest.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b32f389

Please sign in to comment.