mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
786cb5ac3c
41
.github/workflows/auto-merge.yml
vendored
41
.github/workflows/auto-merge.yml
vendored
@ -4,25 +4,47 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.repository }}
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.repository }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
run-name: Auto merge ${{ github.ref }}-${{ inputs.repository }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
repository:
|
repository:
|
||||||
description: 'Please enter a repository name'
|
description: 'Please enter a repository name'
|
||||||
|
branch:
|
||||||
|
type: choice
|
||||||
|
description: 'Base branch'
|
||||||
|
options:
|
||||||
|
- main
|
||||||
|
- next
|
||||||
|
default: main
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
- 'next'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push-commit:
|
push-commit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Get branch
|
||||||
|
id: get-branch
|
||||||
|
run: |
|
||||||
|
if [[ "${{ inputs.branch || github.head_ref || github.ref_name }}" == "main" ]]; then
|
||||||
|
echo "baseBranch=$(echo 'main')" >> $GITHUB_OUTPUT
|
||||||
|
echo "targetBranch=$(echo 'next')" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "${{ inputs.branch || github.head_ref || github.ref_name }}" == "next" ]]; then
|
||||||
|
echo "baseBranch=$(echo 'next')" >> $GITHUB_OUTPUT
|
||||||
|
echo "target=$(echo 'develop')" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ vars.NOCOBASE_APP_ID }}
|
app-id: ${{ vars.NOCOBASE_APP_ID }}
|
||||||
private-key: ${{ secrets.NOCOBASE_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.NOCOBASE_APP_PRIVATE_KEY }}
|
||||||
repositories: nocobase,pro-plugins,plugin-pro-tpl,${{ join(fromJSON(vars.NEXT_PRO_PLUGIN_REPOS), ',') }},${{ join(fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS), ',') }}
|
repositories: nocobase,${{ inputs.repository }}
|
||||||
skip-token-revoke: true
|
skip-token-revoke: true
|
||||||
- name: Get GitHub App User ID
|
- name: Get GitHub App User ID
|
||||||
id: get-user-id
|
id: get-user-id
|
||||||
@ -32,23 +54,24 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
ref: ${{ steps.get-branch.outputs.baseBranch }}
|
||||||
repository: nocobase/${{ inputs.repository || 'nocobase' }}
|
repository: nocobase/${{ inputs.repository || 'nocobase' }}
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: main -> next(${{ inputs.repository || 'nocobase' }})
|
- name: ${{ steps.get-branch.outputs.baseBranch }} -> ${{ steps.get-branch.outputs.targetBranch }} (${{ inputs.repository || 'nocobase' }})
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
|
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
|
||||||
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
|
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
|
||||||
git checkout main
|
git checkout ${{ steps.get-branch.outputs.baseBranch }}
|
||||||
git pull origin main
|
git pull origin ${{ steps.get-branch.outputs.baseBranch }}
|
||||||
git checkout next
|
git checkout ${{ steps.get-branch.outputs.targetBranch }}
|
||||||
git merge main
|
git merge ${{ steps.get-branch.outputs.baseBranch }}
|
||||||
git push origin next
|
git push origin ${{ steps.get-branch.outputs.targetBranch }}
|
||||||
- name: push ${{ inputs.repository || 'nocobase' }}(next)
|
- name: push ${{ inputs.repository || 'nocobase' }}(${{ steps.get-branch.outputs.targetBranch }})
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
branch: next
|
branch: ${{ steps.get-branch.outputs.targetBranch }}
|
||||||
github_token: ${{ steps.app-token.outputs.token }}
|
github_token: ${{ steps.app-token.outputs.token }}
|
||||||
repository: nocobase/${{ inputs.repository || 'nocobase' }}
|
repository: nocobase/${{ inputs.repository || 'nocobase' }}
|
||||||
tags: true
|
tags: true
|
||||||
|
6
.github/workflows/create-branch.yml
vendored
6
.github/workflows/create-branch.yml
vendored
@ -20,11 +20,7 @@ jobs:
|
|||||||
repo:
|
repo:
|
||||||
- 'nocobase'
|
- 'nocobase'
|
||||||
- 'pro-plugins'
|
- 'pro-plugins'
|
||||||
- ${{ fromJSON(needs.get-plugins.outputs.custom-plugins) }}
|
- ${{ fromJSON(needs.get-plugins.outputs.all-plugins) }}
|
||||||
- ${{ fromJSON(needs.get-plugins.outputs.rc-plugins) }}
|
|
||||||
- ${{ fromJSON(needs.get-plugins.outputs.beta-plugins) }}
|
|
||||||
- ${{ fromJSON(needs.get-plugins.outputs.alpha-plugins) }}
|
|
||||||
- ${{ fromJSON(needs.get-plugins.outputs.unreleased-plugins) }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v1
|
||||||
|
8
.github/workflows/get-plugins.yml
vendored
8
.github/workflows/get-plugins.yml
vendored
@ -3,6 +3,8 @@ name: Get plugins
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
outputs:
|
outputs:
|
||||||
|
all-plugins:
|
||||||
|
value: ${{ jobs.get-plugins.outputs.all-plugins }}
|
||||||
custom-plugins:
|
custom-plugins:
|
||||||
value: ${{ jobs.get-plugins.outputs.custom-plugins }}
|
value: ${{ jobs.get-plugins.outputs.custom-plugins }}
|
||||||
rc-plugins:
|
rc-plugins:
|
||||||
@ -18,6 +20,7 @@ jobs:
|
|||||||
get-plugins:
|
get-plugins:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
|
all-plugins: ${{ steps.get-plugins.outputs.all-plugins }}
|
||||||
custom-plugins: ${{ steps.get-plugins.outputs.custom-plugins }}
|
custom-plugins: ${{ steps.get-plugins.outputs.custom-plugins }}
|
||||||
rc-plugins: ${{ steps.get-plugins.outputs.rc-plugins }}
|
rc-plugins: ${{ steps.get-plugins.outputs.rc-plugins }}
|
||||||
beta-plugins: ${{ steps.get-plugins.outputs.beta-plugins }}
|
beta-plugins: ${{ steps.get-plugins.outputs.beta-plugins }}
|
||||||
@ -34,10 +37,11 @@ jobs:
|
|||||||
- id: get-plugins
|
- id: get-plugins
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
echo "all-plugins=$(gh search repos "props.plugin-type:custom,rc,beta,alpha,unreleased" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
||||||
echo "custom-plugins=$(gh search repos "props.plugin-type:custom" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
echo "custom-plugins=$(gh search repos "props.plugin-type:custom" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
||||||
echo "rc-plugins=$(gh search repos "props.plugin-type:rc" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
echo "rc-plugins=$(gh search repos "props.plugin-type:rc" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
||||||
echo "beta-plugins=$(gh search repos "props.plugin-type:beta" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
echo "beta-plugins=$(gh search repos "props.plugin-type:beta,rc" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
||||||
echo "alpha-plugins=$(gh search repos "props.plugin-type:alpha" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
echo "alpha-plugins=$(gh search repos "props.plugin-type:alpha,beta,rc" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
||||||
echo "unreleased-plugins=$(gh search repos "props.plugin-type:unreleased" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
echo "unreleased-plugins=$(gh search repos "props.plugin-type:unreleased" --owner=nocobase --json name | jq -r 'map(.name) | tostring')" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user