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 new file mode 100644 index 0000000..381c56f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,37 @@ + +# Pull Request Template + +## 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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2255a81..4602417 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: zip: - description: 'The url to the zip file' + description: "The url to the zip file" required: true jobs: @@ -19,10 +19,10 @@ jobs: run: | curl -L ${{ github.event.inputs.zip }} -o _site.zip unzip _site.zip -d _site - find _site -name __MACOSX -exec rm -rf {} \; + find _site -name __MACOSX | xargs rm -rf - name: ๐Ÿ“ฆ Upload '_site' - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 - name: ๐Ÿš€ Deploy To GitHub Pages - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index 3c88cc9..0000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,39 +0,0 @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 179eb1d..8b97d60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ name: ๐Ÿ”– Release +run-name: ๐Ÿ”– Release (${{ github.ref_name }}) on: workflow_dispatch: @@ -35,20 +36,9 @@ jobs: @semantic-release/changelog @semantic-release/git env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GH_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 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af9972a..d1dd4eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,15 +3,21 @@ # UNITY_EMAIL: Unity user email to login # UNITY_PASSWORD: Unity user password to login name: ๐Ÿงช Test +run-name: ๐Ÿงช Test (${{ github.event.pull_request.title || github.ref_name }}) env: # MINIMUM_VERSION: The minimum version of Unity. MINIMUM_VERSION: 2019.4 # EXCLUDE_FILTER: The excluded versions of Unity. - EXCLUDE_FILTER: '(2020.2.0)' + EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.3)" on: workflow_dispatch: + inputs: + usePeriodVersions: + description: "Use the period versions (.0f1, .10f1, 20f1, ...)." + required: false + default: "true" push: branches: - develop @@ -19,11 +25,14 @@ on: tags: - "!*" paths-ignore: - - "*.md" - pull_request: + - "**.md" + pull_request_target: types: - opened + - reopened - synchronize + paths-ignore: + - "**.md" jobs: setup: @@ -36,9 +45,12 @@ jobs: 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=[] + LATEST_VERSIONS=`npx unity-changeset@latest list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all` + if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then + ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json` + else + ADDITIONAL_VERSIONS=[] + fi VERSIONS=`echo "[${LATEST_VERSIONS}, ${ADDITIONAL_VERSIONS}]" \ | jq -c '[ flatten | sort | unique | .[] | select( test("${{ env.EXCLUDE_FILTER }}") | not ) ]'` @@ -47,33 +59,44 @@ 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 needs: setup strategy: fail-fast: false - max-parallel: 4 + max-parallel: 6 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: @@ -81,6 +104,10 @@ 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 @@ -91,4 +118,7 @@ jobs: customParameters: -nographics checkName: ${{ matrix.unityVersion }} Test Results githubToken: ${{ github.token }} - coverageOptions: "dontClear;generateHtmlReport;generateBadgeReport;pathFilters:+**/Packages/src/**;assemblyFilters:+,-*.Editor,-*.Test" + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} diff --git a/Packages/src/README.md b/Packages/src/README.md index 72d9064..6ccca32 100644 --- a/Packages/src/README.md +++ b/Packages/src/README.md @@ -28,7 +28,7 @@ Custom properties for changing material properties are easy for experienced user This package provides a component that allows easy modification of material properties for Unity UI (uGUI) without the need for shader-specific custom components. -![](https://github.com/mob-sakai/UIMaterialPropertyInjector/assets/12690315/adaf45ed-5852-4844-ad1a-daa231225be7) +![](https://github.com/user-attachments/assets/fcc54340-9fa5-4a7d-bc5b-3ccd7b317502) **Key Features:** @@ -71,7 +71,7 @@ _This package requires **Unity 2019.4 or later**._ ``` - To update the package, use Package Manager UI (`Window > Package Manager`) or run the following command with `@{version}`: ``` - openupm add com.coffee.ui-material-property-injector@1.0.0 + openupm add com.coffee.ui-material-property-injector@1.1.0 ``` #### Install via UPM (with Package Manager UI) @@ -80,7 +80,7 @@ _This package requires **Unity 2019.4 or later**._ - Click `+ > Add package from git URL...` and input the repository URL: `https://github.com/mob-sakai/UIMaterialPropertyInjector.git?path=Packages/src` ![](https://gist.github.com/assets/12690315/24af63ed-8a2e-483d-9023-7aa53d913330) - To update the package, change suffix `#{version}` to the target version. - - e.g. `https://github.com/mob-sakai/UIMaterialPropertyInjector.git?path=Packages/src#1.0.0` + - e.g. `https://github.com/mob-sakai/UIMaterialPropertyInjector.git?path=Packages/src#1.1.0` #### Install via UPM (Manually) @@ -95,7 +95,7 @@ _This package requires **Unity 2019.4 or later**._ ``` - To update the package, change suffix `#{version}` to the target version. - - e.g. `"com.coffee.ui-material-property-injector": "https://github.com/mob-sakai/UIMaterialPropertyInjector.git?path=Packages/src#1.0.0",` + - e.g. `"com.coffee.ui-material-property-injector": "https://github.com/mob-sakai/UIMaterialPropertyInjector.git?path=Packages/src#1.1.0",` #### Install as Embedded Package @@ -201,4 +201,4 @@ Your support allows me to dedicate more time to development. ๐Ÿ˜Š * GitHub page : https://github.com/mob-sakai/UIMaterialPropertyInjector * Releases : https://github.com/mob-sakai/UIMaterialPropertyInjector/releases * Issue tracker : https://github.com/mob-sakai/UIMaterialPropertyInjector/issues -* Change log : https://github.com/mob-sakai/UIMaterialPropertyInjector/blob/main/CHANGELOG.md +* Change log : https://github.com/mob-sakai/UIMaterialPropertyInjector/blob/main/Packages/src/CHANGELOG.md