From 7c50d0096e02c3ce273a1767f593c249171f165b Mon Sep 17 00:00:00 2001 From: HUI Date: Wed, 8 Nov 2023 23:23:04 +0800 Subject: [PATCH] ci: support update dependencies --- .github/actions/doc/action.yml | 24 +++++++++++++++--------- .github/workflows/dep.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/doc.yml | 6 +++++- .github/workflows/terra.yml | 17 ++++++++++------- 4 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/dep.yml diff --git a/.github/actions/doc/action.yml b/.github/actions/doc/action.yml index afa6d66aa..d5d37aee9 100644 --- a/.github/actions/doc/action.yml +++ b/.github/actions/doc/action.yml @@ -1,25 +1,31 @@ name: Doc -description: Generate comments +description: Generate comments. inputs: - target-path: - description: The path to generate comments, if set, will skip clone & pr - default: "" github-token: - description: The github token + description: > + GITHUB_TOKEN (permissions contents: write and pull-requests: write) or a repo scoped Personal Access Token (PAT). required: true + target-repo: + description: Relative path under GITHUB_WORKSPACE to the repository. + + target-branch: + description: Sets the pull request base branch. + runs: using: composite steps: - name: Generate comments uses: AgoraIO-Extensions/actions/.github/actions/doc@main with: - target-repo: ${{ github.repository }} - target-branch: ${{ github.ref_name }} - target-path: ${{ inputs.target-path }} + github-token: ${{ inputs.github-token }} + target-repo: ${{ inputs.target-repo }} + target-branch: ${{ inputs.target-branch }} config: fmt_config/fmt_ts.yaml language: ts base-template-url: https://github.com/AgoraIO/agora_doc_source/releases/download/master-build/electron_ng_json_template_en.json export-file-path: ts/AgoraSdk.ts - github-token: ${{ inputs.github-token }} + pre-pr-command: | + rm -rf iris-doc + yarn lint --fix diff --git a/.github/workflows/dep.yml b/.github/workflows/dep.yml new file mode 100644 index 000000000..f6a0e3953 --- /dev/null +++ b/.github/workflows/dep.yml @@ -0,0 +1,29 @@ +name: Update dependencies + +on: + workflow_dispatch: + inputs: + dependencies-content: + description: The content of dependencies + required: true + type: string + +jobs: + update-dependencies: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Update dependencies + id: dep + uses: AgoraIO-Extensions/actions/.github/actions/dep@main + with: + github-token: ${{ secrets.GH_TOKEN }} + target-branch: ${{ github.ref_name }} + dependencies-content: ${{ inputs.dependencies-content }} + target-files: | + package.json diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index de6d997a5..ff175641b 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -9,8 +9,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - + + - name: Setup + uses: ./.github/actions/setup + - name: Generate comments uses: ./.github/actions/doc with: github-token: ${{ secrets.GH_TOKEN }} + target-branch: ${{ github.ref_name }} diff --git a/.github/workflows/terra.yml b/.github/workflows/terra.yml index ca597fc71..2e249f315 100644 --- a/.github/workflows/terra.yml +++ b/.github/workflows/terra.yml @@ -19,17 +19,17 @@ jobs: uses: ./.github/actions/setup - name: Generate codes + id: terra uses: AgoraIO-Extensions/actions/.github/actions/terra@main env: LLVM_DOWNLOAD_URL: | https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz with: + github-token: ${{ secrets.GH_TOKEN }} terra-ref: ${{ inputs.terra-ref }} - target-path: ${{ github.workspace }} config: ci/config/terra_config.yaml output-dir: ts/Private export-file-path: ts/AgoraSdk.ts - github-token: ${{ secrets.GH_TOKEN }} - name: Format codes run: | @@ -43,17 +43,20 @@ jobs: - name: Generate comments uses: ./.github/actions/doc with: - target-path: ${{ github.workspace }} github-token: ${{ secrets.GH_TOKEN }} + target-path: ${{ github.workspace }} - 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 + target-branch-name-surffix: terra-update pull-request-title: | - [AUTO] Generate code by terra + [AUTO] Generate codes by terra + pull-request-body: | + Terra configuration: + + ${{ steps.terra.outputs.configuration }} add-paths: ts - github-token: ${{ secrets.GH_TOKEN }}