mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 01:56:16 +00:00
chore(ci): optimize (#5501)
Some checks are pending
Build docker image / build-and-push (push) Waiting to run
Build pro image / build-and-push (push) Waiting to run
Deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase backend test / sqlite-test (20, false) (push) Waiting to run
NocoBase backend test / sqlite-test (20, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, true) (push) Waiting to run
NocoBase backend test / mysql-test (20, false) (push) Waiting to run
NocoBase backend test / mysql-test (20, true) (push) Waiting to run
NocoBase backend test / mariadb-test (20, false) (push) Waiting to run
NocoBase backend test / mariadb-test (20, true) (push) Waiting to run
NocoBase frontEnd test / frontend-test (18) (push) Waiting to run
Test on Windows / build (push) Waiting to run
Some checks are pending
Build docker image / build-and-push (push) Waiting to run
Build pro image / build-and-push (push) Waiting to run
Deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase backend test / sqlite-test (20, false) (push) Waiting to run
NocoBase backend test / sqlite-test (20, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, true) (push) Waiting to run
NocoBase backend test / mysql-test (20, false) (push) Waiting to run
NocoBase backend test / mysql-test (20, true) (push) Waiting to run
NocoBase backend test / mariadb-test (20, false) (push) Waiting to run
NocoBase backend test / mariadb-test (20, true) (push) Waiting to run
NocoBase frontEnd test / frontend-test (18) (push) Waiting to run
Test on Windows / build (push) Waiting to run
* chore(ci): optimize * chore: update * chore: update * chore: update * chore: update * chore: update * chore: update * chore: update * chore: update
This commit is contained in:
parent
4a6bf09737
commit
48f1827f94
30
.github/workflows/changelog-and-release.yml
vendored
30
.github/workflows/changelog-and-release.yml
vendored
@ -22,31 +22,33 @@ jobs:
|
|||||||
write-changelog-and-release:
|
write-changelog-and-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Get info
|
||||||
|
id: get-info
|
||||||
|
run: |
|
||||||
|
if [[ "${{ inputs.version }}" == "alpha" ]]; then
|
||||||
|
echo "branch=$(echo 'next')" >> $GITHUB_OUTPUT
|
||||||
|
echo "proRepos=$(echo '${{ vars.NEXT_PRO_PLUGIN_REPOS }}')" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "branch=$(echo 'main')" >> $GITHUB_OUTPUT
|
||||||
|
echo "proRepos=$(echo '${{ vars.PRO_PLUGIN_REPOS }}')" >> $GITHUB_OUTPUT
|
||||||
|
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,${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ',') }}
|
repositories: nocobase,pro-plugins,${{ join(fromJSON(steps.get-info.outputs.proRepos), ',') }}
|
||||||
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
|
||||||
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
|
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
- name: Get branch
|
|
||||||
id: get-branch
|
|
||||||
run: |
|
|
||||||
if [[ "${{ inputs.version }}" == "alpha" ]]; then
|
|
||||||
echo "branch=$(echo 'next')" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "branch=$(echo 'main')" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: nocobase/nocobase
|
repository: nocobase/nocobase
|
||||||
ref: ${{ steps.get-branch.outputs.branch }}
|
ref: ${{ steps.get-info.outputs.branch }}
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -55,16 +57,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: nocobase/pro-plugins
|
repository: nocobase/pro-plugins
|
||||||
path: packages/pro-plugins
|
path: packages/pro-plugins
|
||||||
ref: ${{ steps.get-branch.outputs.branch }}
|
ref: ${{ steps.get-info.outputs.branch }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- name: Clone pro repos
|
- name: Clone pro repos
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
for repo in ${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ' ') }}
|
for repo in ${{ join(fromJSON(steps.get-info.outputs.proRepos), ' ') }}
|
||||||
do
|
do
|
||||||
git clone -b ${{ steps.get-branch.outputs.branch }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
|
git clone -b ${{ steps.get-info.outputs.branch }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
|
||||||
done
|
done
|
||||||
- name: Set user
|
- name: Set user
|
||||||
run: |
|
run: |
|
||||||
@ -81,7 +83,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
node scripts/release/changelogAndRelease.js --ver ${{ inputs.version }} --cmsURL ${{ secrets.CMS_URL }} --cmsToken ${{ secrets.CMS_TOKEN }}
|
node scripts/release/changelogAndRelease.js --ver ${{ inputs.version }} --cmsURL ${{ secrets.CMS_URL }} --cmsToken ${{ secrets.CMS_TOKEN }}
|
||||||
env:
|
env:
|
||||||
PRO_PLUGIN_REPOS: ${{ vars.PRO_PLUGIN_REPOS }}
|
PRO_PLUGIN_REPOS: ${{ steps.get-info.outputs.proRepos }}
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
- name: Commit and push
|
- name: Commit and push
|
||||||
run: |
|
run: |
|
||||||
|
31
.github/workflows/manual-build-pro-image.yml
vendored
31
.github/workflows/manual-build-pro-image.yml
vendored
@ -88,23 +88,24 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
with:
|
with:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
nocobase/nocobase
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=ref,event=pr
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
- name: Login to Aliyun Container Registry
|
- name: Login to Aliyun Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.ALI_DOCKER_REGISTRY }}
|
registry: ${{ secrets.ALI_DOCKER_REGISTRY }}
|
||||||
username: ${{ secrets.ALI_DOCKER_USERNAME }}
|
username: ${{ secrets.ALI_DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
|
password: ${{ secrets.ALI_DOCKER_PASSWORD }}
|
||||||
|
- name: Get tag
|
||||||
|
id: get-tag
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.pr_number }}" != "" ]; then
|
||||||
|
echo "tag=pr-${{ inputs.pr_number }}" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "tag=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
- name: Set tags
|
||||||
|
id: set-tags
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=tags::${{ secrets.ALI_DOCKER_REGISTRY }}/nocobase/nocobase:${{ steps.get-tag.outputs.tag }}-pro
|
||||||
- name: Set variables
|
- name: Set variables
|
||||||
run: |
|
run: |
|
||||||
target_directory="./packages/pro-plugins/@nocobase"
|
target_directory="./packages/pro-plugins/@nocobase"
|
||||||
@ -117,7 +118,7 @@ jobs:
|
|||||||
echo "var1=$BEFORE_PACK_NOCOBASE" >> $GITHUB_OUTPUT
|
echo "var1=$BEFORE_PACK_NOCOBASE" >> $GITHUB_OUTPUT
|
||||||
echo "var2=$APPEND_PRESET_LOCAL_PLUGINS" >> $GITHUB_OUTPUT
|
echo "var2=$APPEND_PRESET_LOCAL_PLUGINS" >> $GITHUB_OUTPUT
|
||||||
id: vars
|
id: vars
|
||||||
- name: Build and push - pr-${{ inputs.pr_number }}-pro
|
- name: Build and push - ${{ steps.get-tag.outputs.tag }}-pro
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@ -129,12 +130,12 @@ jobs:
|
|||||||
BEFORE_PACK_NOCOBASE=${{ steps.vars.outputs.var1 }}
|
BEFORE_PACK_NOCOBASE=${{ steps.vars.outputs.var1 }}
|
||||||
APPEND_PRESET_LOCAL_PLUGINS=${{ steps.vars.outputs.var2 }}
|
APPEND_PRESET_LOCAL_PLUGINS=${{ steps.vars.outputs.var2 }}
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.ALI_DOCKER_REGISTRY }}/nocobase/nocobase:pr-${{ inputs.pr_number }}-pro
|
tags: ${{ steps.set-tags.outputs.tags }}
|
||||||
- name: Deploy NocoBase
|
- name: Deploy NocoBase
|
||||||
run: |
|
run: |
|
||||||
curl --retry 2 --location --request POST "${{secrets.NOCOBASE_DEPLOY_HOST}}pr-${{ inputs.pr_number }}-pro" \
|
curl --retry 2 --location --request POST "${{secrets.NOCOBASE_DEPLOY_HOST}}${{ steps.get-tag.outputs.tag }}-pro" \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
-d "{
|
-d "{
|
||||||
\"tag\": \"pr-${{ inputs.pr_number }}-pro\",
|
\"tag\": \"${{ steps.get-tag.outputs.tag }}-pro\",
|
||||||
\"dialect\": \"postgres\"
|
\"dialect\": \"postgres\"
|
||||||
}"
|
}"
|
||||||
|
8
.github/workflows/release-next.yml
vendored
8
.github/workflows/release-next.yml
vendored
@ -10,8 +10,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
publish-npm:
|
publish-npm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: node:18
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set Node.js 18
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
@ -27,7 +30,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
repository: nocobase/nocobase
|
||||||
ref: next
|
ref: next
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
persist-credentials: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Send curl request and parse response
|
- name: Send curl request and parse response
|
||||||
env:
|
env:
|
||||||
|
@ -381,7 +381,7 @@ async function getVersion() {
|
|||||||
return { from, to };
|
return { from, to };
|
||||||
}
|
}
|
||||||
|
|
||||||
async function postCMS(title, content, contentCN) {
|
async function postCMS(tag, content, contentCN) {
|
||||||
const { cmsToken, cmsURL } = program.opts();
|
const { cmsToken, cmsURL } = program.opts();
|
||||||
if (!cmsToken || !cmsURL) {
|
if (!cmsToken || !cmsURL) {
|
||||||
console.error('No cmsToken or cmsURL provided');
|
console.error('No cmsToken or cmsURL provided');
|
||||||
@ -394,13 +394,16 @@ async function postCMS(title, content, contentCN) {
|
|||||||
Authorization: `Bearer ${cmsToken}`,
|
Authorization: `Bearer ${cmsToken}`,
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
filterKeys: ['title'],
|
filterKeys: ['slug'],
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
title,
|
slug: tag,
|
||||||
title_cn: title,
|
title: `Nocobase ${tag}`,
|
||||||
|
title_cn: `Nocobase ${tag}`,
|
||||||
content,
|
content,
|
||||||
content_cn: contentCN,
|
content_cn: contentCN,
|
||||||
|
description: `Release Note of ${tag}`,
|
||||||
|
description_cn: `${tag} 更新日志`,
|
||||||
tags: [4],
|
tags: [4],
|
||||||
status: 'drafted',
|
status: 'drafted',
|
||||||
author: 'nocobase [bot]',
|
author: 'nocobase [bot]',
|
||||||
|
Loading…
Reference in New Issue
Block a user