Generate codes and create pull request #25
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 codes and create pull request | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dependencies-content: | |
| description: The content of dependencies | |
| required: true | |
| type: string | |
| jobs: | |
| generate-codes: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup | |
| uses: ./.github/setup | |
| - name: Get dependencies | |
| id: dep | |
| uses: AgoraIO-Extensions/actions/.github/actions/dep@main | |
| with: | |
| dependencies-content: ${{ inputs.dependencies-content }} | |
| - name: Update dependencies | |
| run: | | |
| sh .github/ci/build/dep.sh ${{ steps.dep.outputs.matches }} | |
| - name: Replace rtc version | |
| id: version | |
| run: | | |
| cd Terra | |
| pip install -r requirements.txt | |
| JSON_RAW='${{ steps.dep.outputs.matches }}' | |
| JSON_OUTPUT=$(printf '%s' "$JSON_RAW" | sed 's/^"//;s/"$//' | sed 's/\\"/"/g') | |
| VERSION=$(echo "$JSON_OUTPUT" | jq -r '.[] | select(.version != "" and .version != null) | .version' | head -n 1) | |
| echo "rtc_version=${VERSION}" >> $GITHUB_OUTPUT | |
| python ASDK.py -agorasdk="${VERSION}" | |
| - name: Generate code and comment by terra | |
| uses: AgoraIO-Extensions/actions/.github/actions/generate@main | |
| with: | |
| working-directory: "Terra" | |
| github-token: ${{ secrets.GH_TOKEN }} | |
| generate-code: true | |
| generate-comment: false | |
| generate-code-command: | | |
| mkdir -p packages/cpp | |
| mkdir -p packages/blueprint | |
| bash build.sh | |
| bash finalstep.sh | |
| - name: Create pull request | |
| uses: AgoraIO-Extensions/actions/.github/actions/pr@main | |
| with: | |
| github-token: ${{ secrets.GH_TOKEN }} | |
| target-repo: ${{ github.workspace }} | |
| target-branch: ${{ github.ref_name }} | |
| target-branch-name-surffix: terra-update/${{ steps.version.outputs.rtc_version }} | |
| pull-request-title: | | |
| [AUTO] Generate codes by terra(${{ steps.version.outputs.rtc_version }}) | |
| add-paths: . | |
| # - name: Check csharp codes compile | |
| # run: | | |
| # cd Agora-C_Sharp_RTC-SDK_UT | |
| # dotnet restore Agora_C_Sharp_SDK_UT.sln | |
| # dotnet build Agora_C_Sharp_SDK_UT.sln --configuration Release | |
| # if [ $? -ne 0 ]; then | |
| # echo "csharp codes compile error" | |
| # exit 1 | |
| # else | |
| # echo "csharp codes compile success" | |
| # fi |