Skip to content

refactor: move all packages to crates subdir #3

refactor: move all packages to crates subdir

refactor: move all packages to crates subdir #3

Workflow file for this run

name: Sync to MAA Main Repository
on:
# Dry run on pull request
pull_request:
branches: ["main"]
paths:
- "crates/maa-cli/docs/**"
workflow_call:
inputs:
version:
description: Package version
required: true
type: string
dryrun:
description: Do not create PR
required: true
type: boolean
secrets:
MAA_HOMEBREW_BUMP_PR:
description: GitHub PAT for creating PR
required: true
defaults:
run:
shell: bash
jobs:
bump:
name: Bump Submodules of Main Repository
runs-on: ubuntu-latest
steps:
- name: Checkout Main Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.MAA_HOMEBREW_BUMP_PR }}
repository: MaaAssistantArknights/MaaAssistantArknights
ref: dev
- name: Update Submodule (Workflow Call)
if: github.event_name == 'workflow_call'
working-directory: src/maa-cli
run: |
git submodule init .
git submodule update .
git checkout '${{ github.ref }}'
- name: Checkout Submodule (Pull Request)
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
path: src/maa-cli
- name: Sync Documentations
working-directory: docs
run: |
../src/maa-cli/crates/maa-cli/docs/gen_docs.sh
- name: Show Changes
# Show changes in diff format if it's a pull request or dry run
if: github.event_name == 'pull_request' || inputs.dryrun
run: |
{
echo '```diff'
git diff
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Create Pull Request
if: github.event_name != 'pull_request' && !inputs.dryrun
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MAA_HOMEBREW_BUMP_PR }}
commit-message: |
chore: bump maa-cli to ${{ inputs.version }}
branch: chore/bump/maa-cli-${{ inputs.version }}
title: "chore: bump maa-cli to ${{ inputs.version }}"
body: |
Bump maa-cli to ${{ inputs.version }}.
See [maa-cli changelog](https://github.com/MaaAssistantArknights/maa-cli/releases/tag/v${{ inputs.version }}) for more details.