2024-10-13 03:30:54 +00:00
|
|
|
name: Manual release
|
2024-02-08 03:35:59 +00:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2024-05-09 07:42:08 +00:00
|
|
|
on:
|
2023-12-13 09:06:59 +00:00
|
|
|
workflow_dispatch:
|
2024-08-25 14:07:44 +00:00
|
|
|
inputs:
|
|
|
|
is_feat:
|
|
|
|
description: 'is feat'
|
|
|
|
type: boolean
|
2024-08-06 09:52:23 +00:00
|
|
|
|
2023-12-13 09:06:59 +00:00
|
|
|
jobs:
|
2024-08-26 15:40:48 +00:00
|
|
|
pre-merge-main-into-next:
|
2024-07-16 07:50:21 +00:00
|
|
|
runs-on: ubuntu-latest
|
2024-08-26 15:40:48 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
repo:
|
|
|
|
- 'nocobase'
|
|
|
|
- 'pro-plugins'
|
|
|
|
- ${{ fromJSON(vars.PRO_PLUGIN_REPOS) }}
|
2024-09-04 03:12:08 +00:00
|
|
|
- ${{ fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS) }}
|
2024-07-16 07:50:21 +00:00
|
|
|
steps:
|
2024-09-03 12:44:05 +00:00
|
|
|
- uses: actions/create-github-app-token@v1
|
2024-08-26 15:40:48 +00:00
|
|
|
id: app-token
|
2024-09-03 12:44:05 +00:00
|
|
|
with:
|
|
|
|
app-id: ${{ vars.NOCOBASE_APP_ID }}
|
|
|
|
private-key: ${{ secrets.NOCOBASE_APP_PRIVATE_KEY }}
|
2024-09-04 03:12:08 +00:00
|
|
|
repositories: nocobase,pro-plugins,${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ',') }},${{ join(fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS), ',') }}
|
2024-09-03 12:44:05 +00:00
|
|
|
skip-token-revoke: true
|
|
|
|
- name: Get GitHub App User ID
|
|
|
|
id: get-user-id
|
|
|
|
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
2024-08-26 15:40:48 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
# ref: 'main'
|
|
|
|
repository: nocobase/${{ matrix.repo }}
|
|
|
|
fetch-depth: 0
|
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
|
|
- name: main -> next (nocobase/${{ matrix.repo }})
|
|
|
|
run: |
|
2024-09-03 12:44:05 +00:00
|
|
|
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>'
|
2024-08-26 15:40:48 +00:00
|
|
|
git checkout main
|
|
|
|
git pull origin main
|
|
|
|
git checkout next
|
|
|
|
git merge main
|
|
|
|
git push origin next --tags --atomic
|
|
|
|
update-version:
|
|
|
|
needs:
|
|
|
|
- pre-merge-main-into-next
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-09-03 12:44:05 +00:00
|
|
|
- uses: actions/create-github-app-token@v1
|
2024-08-26 15:40:48 +00:00
|
|
|
id: app-token
|
2024-09-03 12:44:05 +00:00
|
|
|
with:
|
|
|
|
app-id: ${{ vars.NOCOBASE_APP_ID }}
|
|
|
|
private-key: ${{ secrets.NOCOBASE_APP_PRIVATE_KEY }}
|
2024-09-04 03:12:08 +00:00
|
|
|
repositories: nocobase,pro-plugins,${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ',') }},${{ join(fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS), ',') }}
|
2024-09-03 12:44:05 +00:00
|
|
|
skip-token-revoke: true
|
|
|
|
- name: Get GitHub App User ID
|
|
|
|
id: get-user-id
|
|
|
|
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
2024-07-16 07:50:21 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: nocobase/nocobase
|
2024-08-26 15:40:48 +00:00
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
2024-07-16 07:50:21 +00:00
|
|
|
persist-credentials: true
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout pro-plugins
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: nocobase/pro-plugins
|
|
|
|
path: packages/pro-plugins
|
|
|
|
fetch-depth: 0
|
2024-08-26 15:40:48 +00:00
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
2024-07-16 07:50:21 +00:00
|
|
|
persist-credentials: true
|
2024-08-26 15:40:48 +00:00
|
|
|
- name: Clone pro repos
|
|
|
|
shell: bash
|
2024-07-16 07:50:21 +00:00
|
|
|
run: |
|
2024-09-04 03:12:08 +00:00
|
|
|
for repo in ${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ' ') }} ${{ join(fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS), ' ') }}
|
2024-08-26 15:40:48 +00:00
|
|
|
do
|
|
|
|
git clone -b main https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
|
|
|
|
done
|
2024-05-09 07:42:08 +00:00
|
|
|
- name: Set Node.js 18
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
2024-05-09 15:12:42 +00:00
|
|
|
- name: Install Lerna
|
|
|
|
run: npm install -g lerna@4 auto-changelog@2
|
2024-05-09 07:42:08 +00:00
|
|
|
- name: Run release.sh
|
2024-08-26 15:40:48 +00:00
|
|
|
shell: bash
|
2024-05-09 07:42:08 +00:00
|
|
|
run: |
|
2024-07-16 10:58:20 +00:00
|
|
|
cd ./packages/pro-plugins
|
|
|
|
git checkout main
|
2024-09-04 03:12:08 +00:00
|
|
|
for repo in ${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ' ') }} ${{ join(fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS), ' ') }}
|
2024-08-26 15:40:48 +00:00
|
|
|
do
|
|
|
|
echo "@nocobase/$repo" >> .git/info/exclude
|
|
|
|
done
|
|
|
|
echo "$(<.git/info/exclude )"
|
2024-07-16 10:58:20 +00:00
|
|
|
cd ./../..
|
2024-07-16 08:04:28 +00:00
|
|
|
git checkout main
|
2024-09-03 12:44:05 +00:00
|
|
|
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>'
|
2024-08-26 15:40:48 +00:00
|
|
|
echo "packages/pro-plugins" >> .git/info/exclude
|
2024-06-12 03:37:23 +00:00
|
|
|
bash release.sh $IS_FEAT
|
|
|
|
env:
|
2024-08-25 14:07:44 +00:00
|
|
|
IS_FEAT: ${{ inputs.is_feat && '--is-feat' || '' }}
|
2024-08-26 15:40:48 +00:00
|
|
|
PRO_PLUGIN_REPOS: ${{ vars.PRO_PLUGIN_REPOS }}
|
2024-09-04 04:58:51 +00:00
|
|
|
CUSTOM_PRO_PLUGIN_REPOS: ${{ vars.CUSTOM_PRO_PLUGIN_REPOS }}
|
2024-08-26 20:56:27 +00:00
|
|
|
- name: Push and merge into next
|
2024-08-26 15:40:48 +00:00
|
|
|
run: |
|
2024-09-04 03:12:08 +00:00
|
|
|
for repo in ${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ' ') }} ${{ join(fromJSON(vars.CUSTOM_PRO_PLUGIN_REPOS), ' ') }}
|
2024-08-26 15:40:48 +00:00
|
|
|
do
|
|
|
|
cd ./packages/pro-plugins/@nocobase/$repo
|
|
|
|
git push origin main --atomic --tags
|
2024-08-26 20:56:27 +00:00
|
|
|
git checkout next
|
|
|
|
git merge -X ours main --no-edit
|
|
|
|
git push origin next --tags --atomic
|
2024-08-26 15:40:48 +00:00
|
|
|
cd ../../../../
|
|
|
|
done
|
2024-08-26 20:56:27 +00:00
|
|
|
cd ./packages/pro-plugins
|
|
|
|
git push origin main --atomic --tags
|
|
|
|
git checkout next
|
|
|
|
git merge -X ours main --no-edit
|
|
|
|
git push origin next --tags --atomic
|
|
|
|
cd ../../
|
|
|
|
git push origin main --atomic --tags
|
2024-07-16 07:50:21 +00:00
|
|
|
git checkout next
|
|
|
|
git merge -X ours main --no-edit
|
2024-08-26 15:40:48 +00:00
|
|
|
git push origin next --tags --atomic
|