Skip to content

Commit

Permalink
ci: support update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Nov 8, 2023
1 parent 9df0579 commit 7c50d00
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 17 deletions.
24 changes: 15 additions & 9 deletions .github/actions/doc/action.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions .github/workflows/dep.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
17 changes: 10 additions & 7 deletions .github/workflows/terra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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 }}

0 comments on commit 7c50d00

Please sign in to comment.