diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..2ecc390 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,6 @@ +# This is a comment. +# Each line is a file pattern followed by one or more owners. +# https://docs.github.com/ja/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + +# Default owners +* @mob-sakai diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1afb10e..54b49da 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,9 +1,37 @@ ---- -name: Pull Request -about: Create a pull request -title: '' -assignees: mob-sakai ---- +# Pull Request Template -**NOTE: Create a pull request to merge into `develop` branch** +## Description + +- Please include a summary of the change and which issue is fixed. +- Please also include relevant motivation and context. +- List any dependencies that are required for this change. + +Fixes #{issue_number} + +## Type of change + +Please write the commit message in the format corresponding to the change type. +Please see [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for more information. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Update documentations +- [ ] Others (refactoring, style changes, etc.) + +## Test environment + +- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL] +- Unity version: [e.g. 2022.2.0f1] +- Build options: [e.g. IL2CPP, .Net 4.x, URP/HDRP] + +## Checklist + +- [ ] This pull request is for merging into the `develop` branch +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have checked my code and corrected any misspellings \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..762c050 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 | xargs rm -rf + + - name: ๐Ÿ“ฆ Upload '_site' + uses: actions/upload-pages-artifact@v3 + + - name: ๐Ÿš€ Deploy To GitHub Pages + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 925f41d..8b97d60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,9 @@ on: workflow_dispatch: push: branches: - - release - - release-* + - preview + - main + - v*.x tags-ignore: - "**" @@ -22,9 +23,6 @@ jobs: channel: ${{ steps.release.outputs.new_release_channel }} released: ${{ steps.release.outputs.new_release_published }} tag: ${{ steps.release.outputs.new_release_git_tag }} - version: ${{ steps.release.outputs.new_release_version }} - merge_to: ${{ steps.summary.outputs.merge_to }} - split_to: ${{ steps.summary.outputs.split_to }} steps: - name: ๐Ÿšš Checkout (${{ github.ref_name }}) uses: actions/checkout@v4 @@ -38,64 +36,9 @@ jobs: @semantic-release/changelog @semantic-release/git env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - - id: summary - run: | + - run: | echo "๐Ÿ”– New release published: '${{ steps.release.outputs.new_release_published }}'" | tee -a $GITHUB_STEP_SUMMARY - echo "๐Ÿ”– New release version: '${{ steps.release.outputs.new_release_version }}'" | 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 - - if [ '${{ steps.release.outputs.new_release_published }}' = 'false' ]; then - echo "No new release published." | tee -a $GITHUB_STEP_SUMMARY - elif [ '${{ github.ref_name }}' = 'release' ]; then - echo "merge_to=develop" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY - echo "split_to=main" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY - else - channel=$(echo ${{ github.ref_name }} | sed 's/^release-//') - echo "merge_to=develop-${channel}" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY - echo "split_to=${channel}" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY - fi - - merge-to: - if: needs.release.outputs.merge_to != '' - needs: release - name: ๐Ÿ”€ Merge to ${{ needs.release.outputs.merge_to }} - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: ๐Ÿšš Checkout (${{ needs.release.outputs.merge_to }}) - uses: actions/checkout@v4 - with: - ref: ${{ needs.release.outputs.merge_to }} - fetch-depth: 0 - - name: ๐Ÿ”€ Merge '${{ needs.release.outputs.tag }}' into '${{ needs.release.outputs.merge_to }}' - run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - - git merge ${{ needs.release.outputs.tag }} - git push origin ${{ needs.release.outputs.merge_to }} - - split-to: - if: needs.release.outputs.split_to != '' - needs: release - name: ๐Ÿ”€ Split package to ${{ needs.release.outputs.split_to }} - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: ๐Ÿšš Checkout (${{ needs.release.outputs.tag }}) - uses: actions/checkout@v4 - with: - ref: ${{ needs.release.outputs.tag }} - fetch-depth: 0 - - name: ๐Ÿ”€ Split subtree 'Packages/src' to '${{ needs.release.outputs.split_to }}' - run: | - split_to=${{ needs.release.outputs.split_to }} - git branch $split_to origin/$split_to - git subtree split --prefix=Packages/src --branch $split_to - git tag ${{ needs.release.outputs.version }} $split_to - git push origin ${{ needs.release.outputs.version }} $split_to:$split_to diff --git a/.github/workflows/test-urp.yml b/.github/workflows/test-urp.yml index 07f4304..97eaa02 100644 --- a/.github/workflows/test-urp.yml +++ b/.github/workflows/test-urp.yml @@ -3,7 +3,7 @@ # UNITY_EMAIL: Unity user email to login # UNITY_PASSWORD: Unity user password to login name: ๐Ÿงช Test URP -run-name: ๐Ÿงช Test URP (${{ github.ref_name }}) +run-name: ๐Ÿงช Test URP (${{ github.event.pull_request.title || github.ref_name }}) env: # MINIMUM_VERSION: The minimum version of Unity. @@ -25,11 +25,14 @@ on: tags: - "!*" paths-ignore: - - "*.md" - pull_request: + - "**.md" + pull_request_target: types: - opened + - reopened - synchronize + paths-ignore: + - "**.md" jobs: setup: @@ -56,10 +59,6 @@ jobs: 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 @@ -70,14 +69,29 @@ jobs: matrix: unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }} steps: - - name: ๐Ÿšš Checkout + - name: ๐Ÿšš Checkout ($${{ github.ref }}) + if: github.event_name == 'push' + uses: actions/checkout@v4 + + - name: ๐Ÿšš Checkout pull request (pull_request_target) + if: github.event_name == 'pull_request_target' uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: ๐Ÿšš Marge pull request (pull_request_target) + if: github.event_name == 'pull_request_target' + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git merge origin/${{ github.event.pull_request.base.ref }} --no-edit - name: ๐Ÿ“ฅ Cache library uses: actions/cache@v4 with: path: UniversalTestProject/Library - key: UniversalTestProject-Library-${{ matrix.unityVersion }}-${{ github.sha }} + key: UniversalTestProject-Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }} restore-keys: | UniversalTestProject-Library-${{ matrix.unityVersion }}- UniversalTestProject-Library- @@ -90,4 +104,19 @@ jobs: targetPlatform: StandaloneLinux64 allowDirtyBuild: true customParameters: -nographics - projectPath: UniversalTestProject \ No newline at end of file + projectPath: UniversalTestProject + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + + # - 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:+,-*.Editor,-*.Test" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3f0a43..a178f1a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ # UNITY_EMAIL: Unity user email to login # UNITY_PASSWORD: Unity user password to login name: ๐Ÿงช Test -run-name: ๐Ÿงช Test (${{ github.ref_name }}) +run-name: ๐Ÿงช Test (${{ github.event.pull_request.title || github.ref_name }}) env: # MINIMUM_VERSION: The minimum version of Unity. @@ -13,7 +13,7 @@ env: on: workflow_dispatch: - inputs: + inputs: usePeriodVersions: description: 'Use the period versions (.0f1, .10f1, 20f1, ...).' required: false @@ -22,15 +22,17 @@ on: branches: - develop - develop-preview - - develop-1.x tags: - "!*" paths-ignore: - - "*.md" - pull_request: + - "**.md" + pull_request_target: types: - opened + - reopened - synchronize + paths-ignore: + - "**.md" jobs: setup: @@ -57,10 +59,6 @@ jobs: 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 @@ -71,19 +69,34 @@ jobs: matrix: unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }} steps: - - name: ๐Ÿšš Checkout + - name: ๐Ÿšš Checkout ($${{ github.ref }}) + if: github.event_name == 'push' uses: actions/checkout@v4 + - name: ๐Ÿšš Checkout pull request (pull_request_target) + if: github.event_name == 'pull_request_target' + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: ๐Ÿšš Marge pull request (pull_request_target) + if: github.event_name == 'pull_request_target' + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git merge origin/${{ github.event.pull_request.base.ref }} --no-edit + - name: ๐Ÿ“ฅ Cache library uses: actions/cache@v4 with: path: Library - key: Library-${{ matrix.unityVersion }}-${{ github.sha }} + key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }} restore-keys: | Library-${{ matrix.unityVersion }}- Library- - - name: ๐Ÿ› ๏ธ Build Unity Project + - name: ๐Ÿ› ๏ธ Build Unity Project (Test) uses: game-ci/unity-builder@v4 timeout-minutes: 45 with: @@ -91,14 +104,18 @@ jobs: targetPlatform: StandaloneLinux64 allowDirtyBuild: true customParameters: -nographics + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} - - 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:+,-*.Editor,-*.Test" + # - 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:+,-*.Editor,-*.Test"