Skip to content

Commit

Permalink
feat: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed May 23, 2024
1 parent 01e08ee commit 95b697e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
49 changes: 32 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
workflow_dispatch:
push:
branches:
- preview
- release
- release_preview
- release_v4
tags-ignore:
- "**"

Expand All @@ -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
Expand All @@ -38,35 +40,47 @@ 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
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 "split_to=preview" | tee -a $GITHUB_OUTPUT
elif [ '${{ github.ref_name }}' == 'release_v4' ]; then
echo "split_to=v4" | 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
runs-on: ubuntu-latest
Expand All @@ -78,9 +92,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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
push:
branches:
- develop
- develop_v5
tags:
- "!*"
paths-ignore:
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
needs: setup
strategy:
fail-fast: false
max-parallel: 4
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion Packages/src/.releaserc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"branches": [
"release",
"release_v4",
{
"name": "preview",
"name": "release_preview",
"prerelease": true
}
],
Expand Down

0 comments on commit 95b697e

Please sign in to comment.