Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
81e49f6
chore: release package via ci
oasis-cloud Feb 11, 2025
aee957f
chore: release package via ci
oasis-cloud Feb 11, 2025
6a63d0f
chore: release package via ci
oasis-cloud Feb 11, 2025
b1e3750
chore: release package via ci
oasis-cloud Feb 11, 2025
b6e32ca
chore: release package via ci
oasis-cloud Feb 11, 2025
3c509e1
chore: release package via ci
oasis-cloud Feb 11, 2025
4ee850e
chore: release package via ci
oasis-cloud Feb 11, 2025
c29fcca
chore: release package via ci
oasis-cloud Feb 11, 2025
123c17e
chore: release package via ci
oasis-cloud Feb 11, 2025
7b5eb81
chore: 测试手动执行
oasis-cloud Feb 11, 2025
59f4a3b
chore: 测试手动执行
oasis-cloud Feb 11, 2025
578ad3e
chore: 测试手动执行
oasis-cloud Feb 11, 2025
d39c0f6
chore: 测试手动执行
oasis-cloud Feb 11, 2025
da96a90
chore: 测试手动执行
oasis-cloud Feb 11, 2025
0586197
chore: 测试手动执行
oasis-cloud Feb 11, 2025
4c42296
chore: 测试手动执行
oasis-cloud Feb 11, 2025
761927b
chore: 测试手动执行
oasis-cloud Feb 11, 2025
7bebe36
chore: 测试手动执行
oasis-cloud Feb 11, 2025
bbe6ae3
chore: 测试手动执行
oasis-cloud Feb 11, 2025
22cbc88
chore: 测试beta
oasis-cloud Feb 11, 2025
8412fd7
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
17fbacb
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
acb8b58
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
3a7955f
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
661b7a2
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
542c53a
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
e9227b9
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
8eec51f
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
6c8a839
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
38beddf
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
46cf9e8
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
959019b
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
efea6cd
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
4798d00
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
3e3b0d9
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
e4a8d58
chore(release): v3.0.0-beta.12
oasis-cloud Feb 11, 2025
0419a9f
fix: review
oasis-cloud Feb 13, 2025
d5b1d9d
fix: review
oasis-cloud Feb 13, 2025
8f16cea
chore(release): v3.0.0-beta.12
oasis-cloud Feb 13, 2025
d387997
chore(release): v3.0.0-beta.12
oasis-cloud Feb 13, 2025
27dd1f9
chore: remove --dry-run
oasis-cloud Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Release 3x Beta

on:
# pull_request:
push:
branches:
- feat_v3.x
workflow_dispatch:

jobs:
release-3x-beta:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
RELEASE_TAG: beta

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# ref: ${{ github.event.pull_request.head.sha }}

- name: Get commit message
run: |
COMMIT_MESSAGE=$(git log --format=%s -n 1)
FILTERED_MESSAGE="${COMMIT_MESSAGE//[^a-zA-Z0-9.()_:, -]/}"
echo "COMMIT_MESSAGE=${FILTERED_MESSAGE}" >> $GITHUB_ENV
- name: Show commit message
run: echo "$COMMIT_MESSAGE"

- name: Commit message compliance verification
if: |
!startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) ||
!contains( env.COMMIT_MESSAGE , '-beta' )
run: echo "ABORT=true" >> $GITHUB_ENV

- name: Get Tag message
if: contains( env.COMMIT_MESSAGE , '-beta')
run: echo "RELEASE_TAG=beta" >> $GITHUB_ENV

- name: Install pnpm
run: npm install -g pnpm@v9

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
if: env.ABORT != 'true'
run: pnpm install --no-frozen-lockfile

- name: Run Build
if: env.ABORT != 'true'
run: |
if ! pnpm build; then
echo "构建 nutui-react 失败"
exit 1
fi
if ! pnpm build:taro; then
echo "构建 nutui-react-taro 失败"
exit 1
fi

- name: Run Release @nutui/nutui-react
if: env.ABORT != 'true'
run: |
cd ./release/h5 || exit 1
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
echo "发布 @nutui/nutui-react 失败"
exit 1
fi

- name: Run Releases @nutui/nutui-react-taro
if: env.ABORT != 'true'
run: |
cd ./release/taro || exit 1
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
echo "发布 @nutui/nutui-react-taro 失败"
exit 1
fi
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release 3.x

on:
push:
tags:
- v3.*
workflow_dispatch:

jobs:
release-3x:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
run: npm install -g pnpm@v9

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Run Build
if: env.ABORT != 'true'
run: |
if ! pnpm build; then
echo "构建 nutui-react 失败"
exit 1
fi
if ! pnpm build:taro; then
echo "构建 nutui-react-taro 失败"
exit 1
fi

- name: Run Release @nutui/nutui-react
if: env.ABORT != 'true'
run: |
cd ./release/h5 || exit 1
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
echo "发布 @nutui/nutui-react 失败"
exit 1
fi

- name: Run Releases @nutui/nutui-react-taro
if: env.ABORT != 'true'
run: |
cd ./release/taro || exit 1
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
echo "发布 @nutui/nutui-react-taro 失败"
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules
.npmrc
/dist
/dist-demo
/release
/libs
/jd/upload.js
# yarn.lock
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/jdf2e/nutui-react.git"
"url": "git+https://github.com/jdf2e/nutui-react.git"
},
"files": [
"dist",
Expand Down Expand Up @@ -77,9 +77,7 @@
"generate:file:taro:pages": "node scripts/taro/generate-taro-pages.js",
"lint": "eslint ./src/packages/*/",
"lint:fix": "eslint --fix ./src/packages",
"postpublish": "node scripts/postpublish.js",
"prepare": "husky && npm run generate:file && npm run generate:file:taro && npm run generate:file:taro:pages",
"prepublishOnly": "node scripts/prepublish.js",
"publish:beta": "npm publish --tag beta",
"test": "vitest --coverage",
"test:ui": "vitest --ui --coverage",
Expand Down
9 changes: 5 additions & 4 deletions scripts/build-comments-to-dts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { dirname } from 'path'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const dist = 'release/h5/dist'

/**
* 通过 cofnig.json 获取所有组件的数据
Expand Down Expand Up @@ -135,15 +136,15 @@ function addComments(dtsPath, propsTable, componentName) {
}
}

function getDtsPath(key) {
function getDtsPath(key, outDir) {
// Tabs.Tabpane -> tabpane
let name
if (key === 'Tabs.Tabpane') {
name = 'tabpane'
} else {
name = key.toLowerCase().replace('.', '')
}
const file = path.join(__dirname, '../dist/es/packages', name, name + '.d.ts')
const file = path.join(__dirname, `../${outDir}/es/packages`, name, name + '.d.ts')
return file
}

Expand All @@ -170,14 +171,14 @@ export function codeShift(env) {
__dirname,
'../src/packages',
name.toLowerCase(),
env === 'Taro' ? 'doc.taro.md' : 'doc.md'
env === 'taro' ? 'doc.taro.md' : 'doc.md'
)
if (fse.pathExistsSync(componentDocumentPath)) {
const tables = extractPropsTable(
readComponentDocument(componentDocumentPath)
)
Object.keys(tables).forEach((key) => {
const dtsPath = getDtsPath(key)
const dtsPath = getDtsPath(key, env !== 'taro' ? dist : dist.replace('h5', env))
if (fse.pathExistsSync(dtsPath)) {
const table = markdownTable2Json(tables[key])
addComments(dtsPath, table, getComponentName(key))
Expand Down
Loading
Loading