-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add registry release flow and update workflows (#6565)
Co-authored-by: Ali Emir Şen <[email protected]>
- Loading branch information
Showing
5 changed files
with
94 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": ["@changesets/changelog-github", { "repo": "refinedev/refine" }], | ||
"changelog": ["./format.js", { "repo": "refinedev/refine" }], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const clgh = require("@changesets/changelog-github"); | ||
|
||
const changelogFunctions = { | ||
getDependencyReleaseLine: clgh.default.getDependencyReleaseLine, | ||
getReleaseLine: async (changeset, tag, options) => { | ||
const defaultChangeset = await clgh.default.getReleaseLine( | ||
changeset, | ||
tag, | ||
options, | ||
); | ||
|
||
const isValid = ["community", "enterprise"].includes( | ||
process.env.REFINE_RELEASE_TYPE, | ||
); | ||
|
||
if (!isValid) { | ||
console.error( | ||
"❌ REFINE_RELEASE_TYPE must be either community or enterprise", | ||
); | ||
|
||
process.exit(1); | ||
} | ||
|
||
let title = ""; | ||
|
||
if (process.env.REFINE_RELEASE_TYPE === "community") { | ||
title = "\n\n📢 **Refine Community Release** 📢"; | ||
} | ||
|
||
if (process.env.REFINE_RELEASE_TYPE === "enterprise") { | ||
title = "\n\n⚡ **Refine Enterprise Release** ⚡"; | ||
} | ||
|
||
const result = title + defaultChangeset; | ||
|
||
return result; | ||
}, | ||
}; | ||
|
||
exports.default = changelogFunctions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.biome/ | ||
.codesandbox/ | ||
.husky/ | ||
.vscode/ | ||
cypress/ | ||
documentation/ | ||
examples/ | ||
hackathon/ | ||
patches/ | ||
pnpm-lock.yaml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
SECURITY.md | ||
*.md | ||
packages/**/tsconfig.json | ||
packages/**/tsconfig.test.json | ||
packages/**/tsconfig.declarations.json | ||
packages/**/jest.config.js | ||
packages/**/refine.config.js | ||
packages/**/tsup.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,10 @@ jobs: | |
- name: Test | ||
run: pnpm test:all | ||
if: ${{ env.RELEASE_ONLY != 'true' }} | ||
- name: Prepare Community Edition version changesets | ||
if: "!contains(github.event.head_commit.message, 'ci(changesets): version packages')" | ||
run: | | ||
cp -R ./_changeset/* ./.changeset || : && rm -rf ./_changeset/ | ||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@v1 | ||
|
@@ -64,4 +68,17 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.PANKOD_BOT_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
REFINE_RELEASE_TYPE: community | ||
- name: Merge main to next | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PANKOD_BOT_TOKEN }} | ||
GIT_USER_EMAIL: [email protected] | ||
GIT_USER_NAME: Refine Community Bot | ||
if: steps.changesets.outputs.published == 'true' | ||
run: | | ||
git config --global user.email "${{ env.GIT_USER_EMAIL }}" | ||
git config --global user.name "${{ env.GIT_USER_NAME }}" | ||
git checkout next | ||
git merge main | ||
git push origin next |