2024-09-02 06:37:04 +00:00
|
|
|
name: Write changelog and create release
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2024-09-09 02:15:53 +00:00
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
type: choice
|
|
|
|
description: Please choose a version
|
|
|
|
options:
|
|
|
|
- beta
|
|
|
|
- alpha
|
|
|
|
default: beta
|
2024-09-02 06:37:04 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*-beta'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
write-changelog-and-release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-09-03 12:44:05 +00:00
|
|
|
- uses: actions/create-github-app-token@v1
|
2024-09-02 06:37:04 +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 }}
|
|
|
|
repositories: nocobase,pro-plugins,${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ',') }}
|
|
|
|
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-09-02 06:37:04 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: nocobase/nocobase
|
2024-10-18 02:30:58 +00:00
|
|
|
ref: ${{ github.head_ref || github.ref_name }}
|
2024-09-02 06:37:04 +00:00
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
|
|
persist-credentials: true
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout pro-plugins
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: nocobase/pro-plugins
|
|
|
|
path: packages/pro-plugins
|
2024-10-18 02:30:58 +00:00
|
|
|
ref: ${{ github.head_ref || github.ref_name }}
|
2024-09-02 06:37:04 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
|
|
persist-credentials: true
|
|
|
|
- name: Clone pro repos
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
for repo in ${{ join(fromJSON(vars.PRO_PLUGIN_REPOS), ' ') }}
|
|
|
|
do
|
2024-10-18 02:30:58 +00:00
|
|
|
git clone -b ${{ github.head_ref || github.ref_name }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
|
2024-09-02 06:37:04 +00:00
|
|
|
done
|
|
|
|
- name: Set user
|
|
|
|
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-09-02 06:37:04 +00:00
|
|
|
- name: Set Node.js 18
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Run script
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-10-13 03:30:54 +00:00
|
|
|
node scripts/release/changelogAndRelease.js --ver ${{ inputs.version }} --cmsURL ${{ secrets.CMS_URL }} --cmsToken ${{ secrets.CMS_TOKEN }}
|
2024-09-02 06:37:04 +00:00
|
|
|
env:
|
|
|
|
PRO_PLUGIN_REPOS: ${{ vars.PRO_PLUGIN_REPOS }}
|
|
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
|
|
- name: Commit and push
|
|
|
|
run: |
|
2024-09-03 13:08:44 +00:00
|
|
|
git pull origin main
|
2024-09-02 06:37:04 +00:00
|
|
|
git add .
|
|
|
|
git commit -m "docs: update changelogs"
|
|
|
|
git push origin main
|