From 83bd2ee5ad52589033098b1649128f404fa2cb41 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Sat, 1 Jun 2024 09:02:55 +0900 Subject: [PATCH] chore: update workflow --- .github/workflows/release.yml | 54 +++++++++++++++++++++++------------ .github/workflows/test.yml | 4 +++ 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cdf62e9..95861db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,9 @@ on: workflow_dispatch: push: branches: - - preview - release + - release-preview + - release-1.x tags-ignore: - "**" @@ -22,7 +23,8 @@ jobs: released: ${{ steps.release.outputs.new_release_published }} tag: ${{ steps.release.outputs.new_release_git_tag }} version: ${{ steps.release.outputs.new_release_version }} - notes: ${{ steps.release.outputs.new_release_notes }} + 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,38 +40,51 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} - - run: | + - id: summary + 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 - echo '${{ steps.release.outputs.new_release_notes }}' | 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 + echo "split_to=main" | tee -a $GITHUB_OUTPUT + elif [ '${{ github.ref_name }}' = 'release-preview' ]; then + echo "merge_to=develop-preview" | tee -a $GITHUB_OUTPUT + echo "split_to=preview" | tee -a $GITHUB_OUTPUT + elif [ '${{ github.ref_name }}' = 'release-1.x' ]; then + echo "merge_to=develop-1.x" | tee -a $GITHUB_OUTPUT + echo "split_to=1.x" | tee -a $GITHUB_OUTPUT + fi - merge-to-develop: - if: needs.release.outputs.released == 'true' + merge-to: + if: needs.release.outputs.merge_to != '' needs: release - name: ๐Ÿ”€ Merge to develop + name: ๐Ÿ”€ Merge to ${{ needs.release.outputs.merge_to }} runs-on: ubuntu-latest permissions: contents: write steps: - - name: ๐Ÿšš Checkout (develop) + - name: ๐Ÿšš Checkout (${{ needs.release.outputs.merge_to }}) uses: actions/checkout@v4 with: - ref: develop + ref: ${{ needs.release.outputs.merge_to }} fetch-depth: 0 - - name: ๐Ÿ”€ Merge '${{ needs.release.outputs.tag }}' into 'develop' + - 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 develop + git push origin ${{ needs.release.outputs.merge_to }} - split-to-main: - if: needs.release.outputs.released == 'true' + split-to: + if: needs.release.outputs.split_to != '' needs: release - name: ๐Ÿ”€ Split package + name: ๐Ÿ”€ Split package to ${{ needs.release.outputs.split_to }} runs-on: ubuntu-latest permissions: contents: write @@ -79,9 +94,10 @@ jobs: with: ref: ${{ needs.release.outputs.tag }} fetch-depth: 0 - - name: ๐Ÿ”€ Split subtree 'Packages/src' to 'main' + - name: ๐Ÿ”€ Split subtree 'Packages/src' to '${{ needs.release.outputs.split_to }}' run: | - git branch main origin/main - git subtree split --prefix=Packages/src --branch main - git tag ${{ needs.release.outputs.version }} main - git push origin ${{ needs.release.outputs.version }} main:main + 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.yml b/.github/workflows/test.yml index 771aa87..2997b7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,7 @@ 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: @@ -14,6 +15,8 @@ on: push: branches: - develop + - develop-preview + - develop-1.x tags: - "!*" paths-ignore: @@ -55,6 +58,7 @@ jobs: needs: setup strategy: fail-fast: false + max-parallel: 4 matrix: unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }} steps: