mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
feat: new gitflow (#2695)
* chore(docs): use develop branch instead of main * chore(workflows): change to develop * chore(.changeset): change baseBranch to develop * feat(workflows): trigger sync-develop-to-main workflow after publish * feat(workflow): add sync develop to main workflow * chore(workflows): add back "or Publish to NPM" * refactor(workflows): rename tag name from dev to canary * refactor: rename dev to canary * refactor: reaname develop to canary * refactor(workflows): change from develop to canary
This commit is contained in:
parent
1a033fe6f8
commit
f07de03ad1
@ -8,7 +8,7 @@
|
|||||||
"fixed": [],
|
"fixed": [],
|
||||||
"linked": [],
|
"linked": [],
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"baseBranch": "main",
|
"baseBranch": "canary",
|
||||||
"updateInternalDependencies": "patch",
|
"updateInternalDependencies": "patch",
|
||||||
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||||
"onlyUpdatePeerDependentsWhenOutOfRange": true
|
"onlyUpdatePeerDependentsWhenOutOfRange": true
|
||||||
|
|||||||
@ -14,7 +14,7 @@ reviews:
|
|||||||
drafts: false
|
drafts: false
|
||||||
base_branches:
|
base_branches:
|
||||||
- "main"
|
- "main"
|
||||||
- "develop"
|
- "canary"
|
||||||
- "fix/.*"
|
- "fix/.*"
|
||||||
- "chore/.*"
|
- "chore/.*"
|
||||||
- "feat/.*"
|
- "feat/.*"
|
||||||
|
|||||||
2
.github/workflows/QA.yaml
vendored
2
.github/workflows/QA.yaml
vendored
@ -3,7 +3,7 @@ name: QA
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- canary
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
19
.github/workflows/release.yaml
vendored
19
.github/workflows/release.yaml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
- ".changeset/**"
|
- ".changeset/**"
|
||||||
- "packages/**"
|
- "packages/**"
|
||||||
branches:
|
branches:
|
||||||
- main
|
- canary
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
@ -41,12 +41,21 @@ jobs:
|
|||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Create @dev release
|
- name: Sync files from canary to main branch if a publish happens
|
||||||
|
if: steps.changesets.outputs.published == 'true'
|
||||||
|
run: |
|
||||||
|
curl -X POST \
|
||||||
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
|
https://api.github.com/repos/owner/repo/dispatches \
|
||||||
|
-d '{"event_type":"sync-canary-to-main"}'
|
||||||
|
|
||||||
|
- name: Create canary release
|
||||||
if: steps.changesets.outputs.published != 'true'
|
if: steps.changesets.outputs.published != 'true'
|
||||||
run: |
|
run: |
|
||||||
git checkout main
|
git checkout canary
|
||||||
pnpm version:dev
|
pnpm version:canary
|
||||||
pnpm release:dev
|
pnpm release:canary
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
43
.github/workflows/sync-canary-to-main.yaml
vendored
Normal file
43
.github/workflows/sync-canary-to-main.yaml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: Sync Canary to Main
|
||||||
|
|
||||||
|
on:
|
||||||
|
# triggered manually in Github
|
||||||
|
workflow_dispatch:
|
||||||
|
# triggered by the type "sync-canary-to-main" (e.g. from release action after publishing)
|
||||||
|
repository_dispatch:
|
||||||
|
types: [sync-canary-to-main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_pull_request:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Ensure all history is fetched
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: repo-sync/pull-request@v2
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
source_branch: "canary"
|
||||||
|
destination_branch: "main"
|
||||||
|
pr_title: "Auto-sync Canary to Main"
|
||||||
|
pr_body: |
|
||||||
|
## Automated: Sync from Canary to Main
|
||||||
|
|
||||||
|
This Pull Request is automatically generated to sync the changes from the Canary branch to the Main branch. Below are the included updates:
|
||||||
|
|
||||||
|
### Triggered by a Direct Push to Canary:
|
||||||
|
- Please check the recent commits on the Canary branch directly as this sync may include multiple changes.
|
||||||
|
|
||||||
|
### Triggered by a Pull Request Merge:
|
||||||
|
- Merged Pull Request: [PR#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) - ${{ github.event.pull_request.title }}
|
||||||
|
- PR Description: ${{ github.event.pull_request.body }}
|
||||||
|
- Merged by: ${{ github.event.pull_request.merged_by.login }}
|
||||||
|
|
||||||
|
### Action Required:
|
||||||
|
- Please review the changes carefully.
|
||||||
|
- Approve and merge the Pull Request if everything is in order.
|
||||||
|
|
||||||
|
Thank you for maintaining the Main branch updated and clean.
|
||||||
@ -57,7 +57,7 @@ https://www.conventionalcommits.org/ or check out the
|
|||||||
|
|
||||||
## Pull Request Guidelines
|
## Pull Request Guidelines
|
||||||
|
|
||||||
- The `main` branch is basically a snapshot of the latest stable version. All development must be done in dedicated branches.
|
- The `main` branch is basically a snapshot of the latest production version. All development must be done in dedicated branches and will be merged to `canary` branch.
|
||||||
- Make sure that Github Actions are green
|
- Make sure that Github Actions are green
|
||||||
- It is good to have multiple small commits while working on the PR. We'll let GitHub squash it automatically before the merge.
|
- It is good to have multiple small commits while working on the PR. We'll let GitHub squash it automatically before the merge.
|
||||||
- If you add a new feature:
|
- If you add a new feature:
|
||||||
@ -73,14 +73,14 @@ https://www.conventionalcommits.org/ or check out the
|
|||||||
|
|
||||||
1. Fork of the nextui repository and clone your fork
|
1. Fork of the nextui repository and clone your fork
|
||||||
|
|
||||||
2. Create a new branch out of the `main` branch. We follow the convention
|
2. Create a new branch out of the `canary` branch. We follow the convention
|
||||||
`[type/scope]`. For example `fix/dropdown-hook` or `docs/menu-typo`. `type`
|
`[type/scope]`. For example `fix/dropdown-hook` or `docs/menu-typo`. `type`
|
||||||
can be either `docs`, `fix`, `feat`, `build`, or any other conventional
|
can be either `docs`, `fix`, `feat`, `build`, or any other conventional
|
||||||
commit type. `scope` is just a short id that describes the scope of work.
|
commit type. `scope` is just a short id that describes the scope of work.
|
||||||
|
|
||||||
3. Make and commit your changes following the
|
3. Make and commit your changes following the
|
||||||
[commit convention](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md#commit-convention).
|
[commit convention](https://github.com/nextui-org/nextui/blob/main/CONTRIBUTING.md#commit-convention).
|
||||||
As you develop, you can run `pnpm build --filter=<module>` and
|
As you canary, you can run `pnpm build --filter=<module>` and
|
||||||
`pnpm test packages/<module>/<pkg>` e.g. `pnpm build --filter=avatar & pnpm test packages/components/avatar` to make sure everything works as expected.
|
`pnpm test packages/<module>/<pkg>` e.g. `pnpm build --filter=avatar & pnpm test packages/components/avatar` to make sure everything works as expected.
|
||||||
|
|
||||||
> To know more about the `--filter` option, please check the turborepo [docs](https://turborepo.org/docs/core-concepts/filtering).
|
> To know more about the `--filter` option, please check the turborepo [docs](https://turborepo.org/docs/core-concepts/filtering).
|
||||||
@ -200,9 +200,9 @@ npm run build
|
|||||||
|
|
||||||
6. Send your pull request:
|
6. Send your pull request:
|
||||||
|
|
||||||
- Send your pull request to the `main` branch
|
- Send your pull request to the `canary` branch
|
||||||
- Your pull request will be reviewed by the maintainers and the maintainers will decide if it is accepted or not
|
- Your pull request will be reviewed by the maintainers and the maintainers will decide if it is accepted or not
|
||||||
- Once the pull request is accepted, the maintainers will merge it to the `main` branch
|
- Once the pull request is accepted, the maintainers will merge it to the `canary` branch
|
||||||
|
|
||||||
## Visual Changes
|
## Visual Changes
|
||||||
|
|
||||||
|
|||||||
@ -46,8 +46,8 @@
|
|||||||
"create:hook": "plop hook",
|
"create:hook": "plop hook",
|
||||||
"version": "changeset version",
|
"version": "changeset version",
|
||||||
"release": "changeset publish",
|
"release": "changeset publish",
|
||||||
"version:dev": "changeset version --snapshot dev-v2",
|
"version:canary": "changeset version --snapshot canary",
|
||||||
"release:dev": "changeset publish --snapshot --no-git-tag --tag dev-v2",
|
"release:canary": "changeset publish --snapshot --no-git-tag --tag canary",
|
||||||
"postinstall": "husky install && pnpm --filter @nextui-org/theme build"
|
"postinstall": "husky install && pnpm --filter @nextui-org/theme build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user