mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 02:21:49 +03:00
chore: add timed update workflow (#1214)
This commit is contained in:
parent
c81a24224e
commit
c096fa156b
71
.github/workflows/update-block-suite.yml
vendored
Normal file
71
.github/workflows/update-block-suite.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
name: Update block-suite version
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# At 02:00 UTC
|
||||
- cron: '0 2 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
# Cancels all previous workflow runs for pull requests that have not completed.
|
||||
# See https://docs.github.com/en/actions/using-jobs/using-concurrency
|
||||
concurrency:
|
||||
# The concurrency group contains the workflow name and the branch name for
|
||||
# pull requests or the commit hash for any other events.
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7
|
||||
|
||||
- name: Use Node.js 18
|
||||
# https://github.com/actions/setup-node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.X'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Get old version
|
||||
id: old-version
|
||||
run: |
|
||||
PACKAGE_VERSION=$(cat apps/web/package.json | jq '.dependencies["@blocksuite/editor"]' | tr -d '"')
|
||||
echo "old-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update block-suite version
|
||||
run: pnpm update:core
|
||||
|
||||
- name: Get new version
|
||||
id: new-version
|
||||
run: |
|
||||
PACKAGE_VERSION=$(cat apps/web/package.json | jq '.dependencies["@blocksuite/editor"]' | tr -d '"')
|
||||
echo "new-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
# https://github.com/actions-js/push
|
||||
- name: Commit push
|
||||
uses: actions-js/push@master
|
||||
with:
|
||||
github_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
message: 'chore: bump blocksuite from ${{ steps.old-version.outputs.old-version }} to ${{ steps.new-version.outputs.new-version }}'
|
||||
force: true
|
||||
branch: refs/heads/bot/bump-core
|
||||
|
||||
# see https://github.com/repo-sync/pull-request
|
||||
- name: Create Pull Request
|
||||
uses: repo-sync/pull-request@v2
|
||||
with:
|
||||
source_branch: bot/bump-core
|
||||
pr_title: 'Bump blocksuite to ${{ steps.new-version.outputs.new-version }}'
|
||||
pr_body: 'Please carefully check the editor functionality before merging the PR.'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,7 +1,7 @@
|
||||
# Bump Blocksuite
|
||||
|
||||
```shell
|
||||
./scripts/upgrade-blocksuite.sh
|
||||
pnpm update:core
|
||||
```
|
||||
|
||||
## Understand the version number
|
||||
|
@ -10,7 +10,7 @@ export const createBlocksuiteWorkspace = (
|
||||
) => {
|
||||
return new BlocksuiteWorkspace({
|
||||
room: workspaceId,
|
||||
defaultFlags: { enable_slash_menu: true },
|
||||
defaultFlags: {},
|
||||
isSSR: typeof window === 'undefined',
|
||||
...workspaceOption,
|
||||
})
|
||||
|
@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage:
|
||||
# ./scripts/upgrade-blocksuite.sh --latest
|
||||
# ./scripts/upgrade-blocksuite.sh 0.4.0-20230209191848-0a912e3
|
||||
|
||||
if [ "$1" == "--latest" ]; then
|
||||
pnpm up "@blocksuite/*" "!@blocksuite/icons" -r -i --latest
|
||||
else
|
||||
pnpm up "@blocksuite/*@${1}" "!@blocksuite/icons" -r
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user