Generate Unity CLI #8203
This file contains hidden or 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
| name: Generate Unity CLI | |
| on: | |
| schedule: | |
| # this cron string runs every 2 hours | |
| - cron: 0 0/2 * * * | |
| workflow_dispatch: | |
| jobs: | |
| generate: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: generate-cli-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| targetPlatform: | |
| - StandaloneOSX | |
| unityVersion: | |
| - 2022.3.7f1 | |
| projectPath: | |
| - client | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET Core SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 10.0.x | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.24.1 | |
| cache-dependency-path: ./otel-collector/beamable-collector/go.sum | |
| - name: Run Setup | |
| run: | | |
| ./setup.sh | |
| - name: Clear old files | |
| working-directory: ./client/Packages/com.beamable/Editor/BeamCli/Commands | |
| run: | | |
| rm -rf *.cs | |
| rm -rf *.cs.meta | |
| - name: Restore Tools | |
| working-directory: ./cli/cli | |
| run: | | |
| dotnet tool restore | |
| - name: List files (pre) | |
| working-directory: ./client/Packages/com.beamable/Editor/BeamCli/Commands | |
| run: ls -a | |
| - name: Build CLI | |
| run: | | |
| ./dev.sh | |
| - name: Delete Trash Files | |
| working-directory: ./client/Packages/com.beamable/Editor/BeamCli/Commands | |
| run: | | |
| rm -rf obj | |
| rm -rf bin | |
| - name: List files (post) | |
| working-directory: ./client/Packages/com.beamable/Editor/BeamCli/Commands | |
| run: ls -a | |
| - name: Check for Changes | |
| run: echo ::set-output name=any::$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi) | |
| id: changes | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v6 | |
| id: cpr | |
| if: ${{ steps.changes.outputs.any == 'true' }} | |
| with: | |
| commit-message: syncing Unity SDK from CLI | |
| token: ${{secrets.CODEGEN_PR_GITHUB_TOKEN}} | |
| title: Unity SDK-CLI Generation | |
| body: The CLI autogenerated these changes to the SDK | |
| branch: update-cli | |
| base: main | |
| labels: bot,generated-api | |
| delete-branch: true | |
| add-paths: | | |
| client/Packages/com.beamable/Editor/BeamCli/Commands | |
| - name: Post to a Slack channel | |
| if: ${{ steps.changes.outputs.any == 'true' && steps.cpr.outputs.pull-request-number }} | |
| id: slack | |
| uses: slackapi/slack-github-action@v1.21.0 | |
| with: | |
| channel-id: C0409CMRKA9 | |
| slack-message: "Unity-CLI Auto generated SDK has changed at ${{ steps.cpr.outputs.pull-request-url }}" | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |