-
-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #732 from Cysharp/feature/UpdateWorkflows
Update workflows
- Loading branch information
Showing
7 changed files
with
97 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: build-docs | ||
name: Update Docs | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
.github/workflows/build-update-sourcegenerator-for-unity.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Update pre-built SourceGenerator for Unity | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- src/MagicOnion.Client.SourceGenerator/** | ||
- src/MagicOnion.Client.SourceGenerator.Unity/** | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: "dry_run: true will never push changes" | ||
required: true | ||
default: "false" | ||
|
||
env: | ||
GIT_TAG: ${{ github.event.inputs.tag }} | ||
DRY_RUN: ${{ github.event.inputs.dry_run }} | ||
DRY_RUN_BRANCH_PREFIX: "test_release" | ||
BUILD_CONFIG: Release | ||
|
||
jobs: | ||
update-sourcegenerator-unity: | ||
name: Update MagicOnion.Client.SourceGenerator.Unity | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main | ||
- name: Publish MagicOnion.Client.SourceGenerator.Unity | ||
run: dotnet publish -c ${{ env.BUILD_CONFIG }} ./src/MagicOnion.Client.SourceGenerator.Unity -o ./src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity | ||
- name: Remove .deps.json and .pdbs | ||
run: | | ||
rm -f ./src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity/*.deps.json | ||
rm -f ./src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/MagicOnion.Client.SourceGenerator.Unity/*.pdb | ||
- name: Check update | ||
id: check_update | ||
run: | | ||
git diff --exit-code || echo "::set-output name=changed::1" | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git commit -m "feat: Update MagicOnion.Client.SourceGenerator.Unity" -a | ||
echo "::set-output name=sha::$(git rev-parse HEAD)" | ||
- name: Check sha | ||
run: echo "SHA ${SHA}" | ||
env: | ||
SHA: ${{ steps.commit.outputs.sha }} | ||
|
||
- name: Create Tag | ||
if: steps.check_update.outputs.changed == '1' | ||
run: git tag ${{ env.GIT_TAG }} | ||
|
||
- name: Push changes | ||
if: env.DRY_RUN == 'false' && steps.check_update.outputs.changed == '1' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
tags: true | ||
|
||
- name: Push changes (dry_run) | ||
if: env.DRY_RUN == 'true' && steps.check_update.outputs.changed == '1' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ env.DRY_RUN_BRANCH_PREFIX }}-${{ env.GIT_TAG }} | ||
tags: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Prevent github change | ||
name: Prevent .github change | ||
on: | ||
pull_request: | ||
paths: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters