From c720d269ab7317cead959a937b5668eeb5052f94 Mon Sep 17 00:00:00 2001 From: Littlegnal <8847263+littleGnAl@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:36:52 +0800 Subject: [PATCH] [ci] Add code-gen.yaml (#1623) Add action to run the `tool/terra` on CI --- .github/workflows/code-gen.yaml | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/code-gen.yaml diff --git a/.github/workflows/code-gen.yaml b/.github/workflows/code-gen.yaml new file mode 100644 index 000000000..80efeefeb --- /dev/null +++ b/.github/workflows/code-gen.yaml @@ -0,0 +1,60 @@ +name: Code gen + +on: + workflow_dispatch: + inputs: + target_branch: + description: The branch to run code-gen + type: string + required: true + default: 'main' + + version: + description: 'The version of native sdk in terra-script' + required: false + type: string + default: '' + +jobs: + run_code_gen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.target_branch }} + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - name: Run code-gen + run: | + bash scripts/code_gen.sh + + - name: Get current date + id: date + run: echo "date=$(date +'%Y%m%d')" >> "$GITHUB_OUTPUT" + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Auto generate codes for native sdk version ${{ inputs.version }}" + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + signoff: false + branch: auto-code-gen-${{ steps.date.outputs.date }} + base: ${{ inputs.target_branch }} + delete-branch: true + title: "Auto generate codes for native sdk ${{ inputs.version }}" + body: | + Auto generate codes for native sdk version ${{ inputs.version }} + + *This pull request is opened by bot* + labels: | + ci:skip + reviewers: | + littleGnAl