mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-21 05:44:51 +08:00
ci: adapt e2e/build-pro-image workflows for v1 branch (#8674)
This commit is contained in:
@@ -27,11 +27,16 @@ on:
|
||||
jobs:
|
||||
get-plugins:
|
||||
uses: nocobase/nocobase/.github/workflows/get-plugins.yml@main
|
||||
with:
|
||||
# For v1 builds, only include repos that have the v1 branch.
|
||||
require_branch: ${{ (github.head_ref || github.ref_name) == 'v1' && 'v1' || '' }}
|
||||
secrets: inherit
|
||||
build-and-push:
|
||||
if: github.event.pull_request.head.repo.fork != true
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-plugins
|
||||
env:
|
||||
BASE_REF: ${{ github.event.pull_request.base.ref || github.ref_name }}
|
||||
services:
|
||||
verdaccio:
|
||||
image: verdaccio/verdaccio:5
|
||||
@@ -64,7 +69,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: nocobase/pro-plugins
|
||||
ref: main
|
||||
ref: ${{ env.BASE_REF }}
|
||||
path: packages/pro-plugins
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
@@ -84,7 +89,7 @@ jobs:
|
||||
run: |
|
||||
for repo in ${{ join(fromJSON(steps.get-pro-plugins.outputs.proRepos), ' ') }}
|
||||
do
|
||||
git clone -b main https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
|
||||
git clone -b ${{ env.BASE_REF }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
|
||||
done
|
||||
- run: |
|
||||
for repo in ${{ join(fromJSON(steps.get-pro-plugins.outputs.proRepos), ' ') }}
|
||||
@@ -96,7 +101,7 @@ jobs:
|
||||
if git show-ref --quiet refs/remotes/origin/${{ github.event.pull_request.base.ref }}; then
|
||||
git checkout ${{ github.event.pull_request.base.ref }}
|
||||
else
|
||||
git checkout next
|
||||
git checkout ${{ env.BASE_REF }}
|
||||
fi
|
||||
fi
|
||||
cd ../../../../
|
||||
|
||||
@@ -10,6 +10,7 @@ on:
|
||||
- 'main'
|
||||
- 'develop'
|
||||
- 'next'
|
||||
- 'v1'
|
||||
paths:
|
||||
- '.github/workflows/e2e.yml'
|
||||
- 'packages/**'
|
||||
@@ -26,6 +27,9 @@ jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Use the PR base branch when available (e.g. v1), otherwise use current ref name.
|
||||
BASE_REF: ${{ github.event.pull_request.base.ref || github.ref_name }}
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
continue-on-error: true # 外部开发者提交 PR 的时候因为没有权限这里会报错,为了能够继续执行后续步骤,所以这里设置为 continue-on-error: true
|
||||
@@ -41,7 +45,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: nocobase/pro-plugins
|
||||
ref: main
|
||||
ref: ${{ env.BASE_REF }}
|
||||
path: packages/pro-plugins
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
@@ -50,7 +54,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: nocobase/plugin-workflow-approval
|
||||
ref: main
|
||||
ref: ${{ env.BASE_REF }}
|
||||
path: packages/pro-plugins/@nocobase/plugin-workflow-approval
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
Reference in New Issue
Block a user