From 81e49f63d999b12d1a53f510e9ce688e279ee8c8 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 12:52:24 +0800 Subject: [PATCH 01/41] chore: release package via ci --- .github/workflows/release.yml | 38 +++++++++ .gitignore | 1 + package.json | 2 - scripts/build-comments-to-dts.mjs | 9 +- scripts/build-taro.mjs | 131 +++++++++++++++++++----------- scripts/build.mjs | 109 ++++++++++++++++--------- scripts/postpublish.js | 13 --- scripts/prepublish.js | 32 -------- 8 files changed, 199 insertions(+), 136 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 scripts/postpublish.js delete mode 100644 scripts/prepublish.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..95684fe8ff --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: : + push: + branches: + - feat_v3.x. + pull_request: + types: [ opened, synchronize, reopened ] + workflow_dispatch: + +jobs: + release: + 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 --frozen-lockfile + + - name: Run Build + run: pnpm build & pnpm build:taro + + - name: Run Release @nutui/nutui-react + run: cd ./release/h5 && npm publish --dry-run + + - name: Run Releases @nutui/nutui-react-taro + run: cd ../../release/taro && npm publish --dry-run diff --git a/.gitignore b/.gitignore index f56e3aa29f..41837b6758 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ node_modules .npmrc /dist /dist-demo +/release /libs /jd/upload.js # yarn.lock diff --git a/package.json b/package.json index a587ddfa5f..ed035a274b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/build-comments-to-dts.mjs b/scripts/build-comments-to-dts.mjs index f944e2a249..ac54b0a62e 100644 --- a/scripts/build-comments-to-dts.mjs +++ b/scripts/build-comments-to-dts.mjs @@ -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 获取所有组件的数据 @@ -135,7 +136,7 @@ function addComments(dtsPath, propsTable, componentName) { } } -function getDtsPath(key) { +function getDtsPath(key, outDir) { // Tabs.Tabpane -> tabpane let name if (key === 'Tabs.Tabpane') { @@ -143,7 +144,7 @@ function getDtsPath(key) { } 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 } @@ -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)) diff --git a/scripts/build-taro.mjs b/scripts/build-taro.mjs index 9391a6fda6..e141dc0f3c 100644 --- a/scripts/build-taro.mjs +++ b/scripts/build-taro.mjs @@ -15,9 +15,11 @@ import { readFileSync } from 'fs' import { relativeFilePath } from './relative-path.mjs' import { codeShift } from './build-comments-to-dts.mjs' import { generate } from './build-theme-typings.mjs' +import packageJson from '../package.json' assert { type: 'json' } const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) +const dist = 'release/taro/dist' const isTypesTaro = (name, type) => { return name.indexOf(type) > -1 @@ -50,8 +52,8 @@ const transform = (file, api, replace) => { if (!path.node.source) return if (!alias) { // 处理这里,文件引入中的相对路径下的types的引入。 - path.node.source.value = (!replace || replace && !isTypesTaro(path.node.source.value, 'types.taro')) - ? path.node.source.value.replace('.taro', '') + path.node.source.value = (!replace || replace && !isTypesTaro(path.node.source.value, 'types.taro')) + ? path.node.source.value.replace('.taro', '') : path.node.source.value return } @@ -112,10 +114,10 @@ async function buildES(p) { const ext = extname(relativePath) const writePath = relativePath.replace(ext, '.js').replace('.taro', '') - await dest(join('dist/es', writePath.replace('../src/', '')), code.code) + await dest(join(`${dist}/es`, writePath.replace('../src/', '')), code.code) } - const files = await glob(['dist/es/packages/**/*.js']) + const files = await glob([`${dist}/es/packages/**/*.js`]) for (const file of files) { const result = transform( { @@ -131,7 +133,7 @@ async function buildES(p) { // 构建 CMD async function buildCJS(p) { - const esFiles = await glob(['dist/es/**/*.js']) + const esFiles = await glob([`${dist}/es/**/*.js`]) for (const path of esFiles) { const code = await swc.transformFileSync(join(__dirname, '../', path), { @@ -154,18 +156,18 @@ async function buildCJS(p) { async function buildDeclaration() { const configPath = join(__dirname, '../tsconfig.taro.json') - const dist = join(__dirname, '../dist/types') + const types = join(__dirname, `../${dist}/types`) await execSync( - `tsc --project ${configPath} --emitDeclarationOnly --declaration --declarationDir ${dist}`, + `tsc --project ${configPath} --emitDeclarationOnly --declaration --declarationDir ${types}`, ) const files = await glob([ - 'dist/types/src/packages/**/*.taro.d.ts', - 'dist/types/src/packages/**/types.d.ts', - 'dist/types/src/packages/**/context.d.ts', - 'dist/types/src/packages/**/utils.d.ts', - 'dist/types/src/locales/*.d.ts', - 'dist/types/src/utils/*.d.ts', + `${dist}/types/src/packages/**/*.taro.d.ts`, + `${dist}/types/src/packages/**/types.d.ts`, + `${dist}/types/src/packages/**/context.d.ts`, + `${dist}/types/src/packages/**/utils.d.ts`, + `${dist}/types/src/locales/*.d.ts`, + `${dist}/types/src/utils/*.d.ts`, ]) for (const file of files) { @@ -174,19 +176,19 @@ async function buildDeclaration() { source: readFileSync(join(__dirname, '../', file), { encoding: 'utf8', }), - path: join(__dirname, '../', file).replace('/dist/types', ''), + path: join(__dirname, '../', file).replace(`/${dist}/types`, ''), }, { jscodeshift: j }, - true + true, ) // 修改文件名,除 types.taro 不改之外,其他都修改。 - let to = file.replace('dist/types/src', '') + let to = file.replace(`${dist}/types/src`, '') to = isTypesTaro(to, 'types.taro') ? to : to.replace('.taro', '') - await dest(join('dist/es', to), result) - await dest(join('dist/cjs', to), result) + await dest(join(`${dist}/es`, to), result) + await dest(join(`${dist}/cjs`, to), result) } - deleteAsync('dist/types') + deleteAsync(`${dist}/types`) } // 构建 UMD @@ -205,6 +207,7 @@ async function buildUMD() { build: { minify: false, emptyOutDir: false, + outDir: dist, rollupOptions: { external: ['react', 'react-dom', '@tarojs/taro', '@tarojs/components'], output: [ @@ -217,7 +220,7 @@ async function buildUMD() { ], }, lib: { - entry: join(__dirname, '../dist/es/packages/nutui.react.build.js'), + entry: join(__dirname, `../${dist}/es/packages/nutui.react.build.js`), }, }, }) @@ -228,7 +231,7 @@ async function buildAllCSS() { async function copyStyles() { await copy( resolve(__dirname, '../src/styles'), - resolve(__dirname, '../dist/styles') + resolve(__dirname, `../${dist}/styles`), ) const content = [ @@ -241,14 +244,15 @@ async function buildAllCSS() { if (projectID) { content[1] = `@import '../variables-${projectID}.scss';` } - const scssFiles = await glob(['dist/es/packages/**/*.scss']) + const scssFiles = await glob([`${dist}/es/packages/**/*.scss`]) scssFiles.forEach((file) => { content.push( - `@import '${relativeFilePath('/dist/style.scss', '/' + file)}';` + `@import '${relativeFilePath(`/${dist}/style.scss`, '/' + file)}';`, ) }) - dest('dist/style.scss', content.join('\n')) + dest(`${dist}/style.scss`, content.join('\n')) } + await copyStyles() await vite.build({ logLevel: 'error', @@ -257,8 +261,9 @@ async function buildAllCSS() { }, build: { emptyOutDir: false, + outDir: dist, lib: { - entry: './dist/style.scss', + entry: `./${dist}/style.scss`, formats: ['es'], name: 'style', fileName: 'style', @@ -278,13 +283,13 @@ async function buildThemeCSS() { rollupOptions: { output: [ { - dir: 'dist/styles/themes', + dir: `${dist}/styles/themes`, assetFileNames: 'default.css', }, ], }, lib: { - entry: './dist/styles/themes/default.scss', + entry: `./${dist}/styles/themes/default.scss`, }, }, }) @@ -294,7 +299,7 @@ async function buildThemeCSS() { async function copyStyles() { await copy( resolve(__dirname, '../src/styles'), - resolve(__dirname, '../dist/styles'), + resolve(__dirname, `../${dist}/styles`), ) let content = [ @@ -310,7 +315,7 @@ async function copyStyles() { ] } - dest('dist/styles/themes/default.scss', content.join('\n')) + dest(`${dist}/styles/themes/default.scss`, content.join('\n')) } // 构建样式 @@ -338,19 +343,19 @@ async function buildCSS(p) { }) const cssPath = relative('src', loadPath) // 写 css 文件 - await dest(join('dist/es', cssPath, 'style/style.css'), code.css) - await dest(join('dist/es', cssPath, 'style/css.js'), `import './style.css'`) + await dest(join(`${dist}/es`, cssPath, 'style/style.css'), code.css) + await dest(join(`${dist}/es`, cssPath, 'style/css.js'), `import './style.css'`) - await dest(join('dist/cjs', cssPath, 'style/style.css'), code.css) + await dest(join(`${dist}/cjs`, cssPath, 'style/style.css'), code.css) await dest( - join('dist/cjs', cssPath, 'style/css.js'), + join(`${dist}/cjs`, cssPath, 'style/css.js'), `import './style.css'`, ) // copy harmonycss if (file.indexOf('countup') === -1) { - await copy(join(__dirname, '../', file.replace('scss', 'harmony.css')), join('dist/cjs', cssPath, 'style/style.harmony.css')) - await copy(join(__dirname, '../', file.replace('scss', 'harmony.css')), join('dist/es', cssPath, 'style/style.harmony.css')) + await copy(join(__dirname, '../', file.replace('scss', 'harmony.css')), join(`${dist}/cjs`, cssPath, 'style/style.harmony.css')) + await copy(join(__dirname, '../', file.replace('scss', 'harmony.css')), join(`${dist}/es`, cssPath, 'style/style.harmony.css')) } // 删除 import @@ -376,8 +381,8 @@ async function buildCSS(p) { ]) .process(button, { from: loadPath, syntax: scss }) .then((result) => { - dest(join('dist/es', cssPath, `style/${base}`), result.css) - dest(join('dist/cjs', cssPath, `style/${base}`), result.css) + dest(join(`${dist}/es`, cssPath, `style/${base}`), result.css) + dest(join(`${dist}/cjs`, cssPath, `style/${base}`), result.css) }) const jsContent = [] @@ -396,17 +401,45 @@ async function buildCSS(p) { jsContent.push(`import './${base}';`) await dest( - join('dist/cjs', cssPath, `style/index.js`), + join(`${dist}/cjs`, cssPath, `style/index.js`), jsContent.join('\n'), ) - await dest(join('dist/es', cssPath, `style/index.js`), jsContent.join('\n')) + await dest(join(`${dist}/es`, cssPath, `style/index.js`), jsContent.join('\n')) } } -console.time('clean dist') -await deleteAsync('dist') -console.timeEnd('clean dist') +function generateReleasePackageJson() { + delete packageJson.dependencies['@nutui/icons-react'] + return JSON.stringify({ + name: '@nutui/nutui-react-taro', + version: packageJson.version, + style: packageJson.style, + main: packageJson.main, + module: packageJson.module, + typings: packageJson.typings, + sideEffects: packageJson.sideEffects, + description: packageJson.description, + keywords: packageJson.keywords, + author: packageJson.author, + license: packageJson.license, + repository: packageJson.repository, + files: packageJson.files, + publishConfig: packageJson.publishConfig, + dependencies: packageJson.dependencies, + peerDependencies: packageJson.peerDependencies, + }) +} +async function copyReleaseFiles() { + const npmPublishDir = dist.replace('dist', '') + await copy(join(__dirname, '../README.md'), join(`${npmPublishDir}/README.md`)) + await copy(join(__dirname, '../CHANGELOG.md'), join(`${npmPublishDir}/CHANGELOG.md`)) + await writeFile(join(__dirname, `../${npmPublishDir}/package.json`), generateReleasePackageJson()) +} + +console.time(`clean ${dist}`) +await deleteAsync(dist) +console.timeEnd(`clean ${dist}`) await generate() @@ -445,12 +478,16 @@ console.timeEnd('Build Declaration') // await exportProps() await deleteAsync([ - 'dist/es/packages/nutui.react.js', - 'dist/es/packages/nutui.react.d.ts', - 'dist/es/packages/nutui.react.scss.d.ts', - 'dist/es/packages/nutui.react.scss.js', + `${dist}/es/packages/nutui.react.js`, + `${dist}/es/packages/nutui.react.d.ts`, + `${dist}/es/packages/nutui.react.scss.d.ts`, + `${dist}/es/packages/nutui.react.scss.js`, ]) console.time('Build JSDoc') -codeShift() +codeShift('taro') console.timeEnd('Build JSDoc') + +console.time('Copy package.json readme.md') +await copyReleaseFiles() +console.timeEnd('Copy package.json readme.md') diff --git a/scripts/build.mjs b/scripts/build.mjs index 7bb0b41170..aed614f99b 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -15,9 +15,11 @@ import { readFileSync } from 'fs' import { relativeFilePath } from './relative-path.mjs' import { codeShift } from './build-comments-to-dts.mjs' import { generate } from './build-theme-typings.mjs' +import packageJson from '../package.json' assert { type: 'json' } const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) +const dist = 'release/h5/dist' // 写文件 async function dest(file, content) { @@ -71,13 +73,13 @@ async function buildES(p) { const ext = extname(relativePath) const writePath = relativePath.replace(ext, '.js') - await dest(join('dist/es', writePath.replace('../src/', '')), code.code) + await dest(join(dist, 'es', writePath.replace('../src/', '')), code.code) } } // 构建 CMD async function buildCJS(p) { - const esFiles = await glob(['dist/es/**/*.js']) + const esFiles = await glob([`${dist}/es/**/*.js`]) for (const path of esFiles) { const code = await swc.transformFileSync(join(__dirname, '../', path), { @@ -100,9 +102,9 @@ async function buildCJS(p) { async function buildDeclaration() { const configPath = join(__dirname, '../tsconfig.h5.json') - const dist = join(__dirname, '../dist/types') + const types = join(__dirname, `../${dist}/types`) await execSync( - `tsc --project ${configPath} --emitDeclarationOnly --declaration --declarationDir ${dist}` + `tsc --project ${configPath} --emitDeclarationOnly --declaration --declarationDir ${types}` ) const transform = (file, api) => { const j = api.jscodeshift.withParser('ts') @@ -120,8 +122,8 @@ async function buildDeclaration() { .toSource() } - const files = await glob(['dist/types/src/**/*.d.ts'], { - ignore: ['dist/types/src/**/*.taro.d.ts'], + const files = await glob([`${dist}/types/src/**/*.d.ts`], { + ignore: [`${dist}/types/src/**/*.taro.d.ts`], }) for (const file of files) { @@ -130,14 +132,14 @@ async function buildDeclaration() { source: readFileSync(join(__dirname, '../', file), { encoding: 'utf8', }), - path: join(__dirname, '../', file).replace('/dist/types', ''), + path: join(__dirname, '../', file).replace(`${dist}/types`, ''), }, { jscodeshift: j } ) - await dest(join('dist/es', file.replace('dist/types/src', '')), result) - await dest(join('dist/cjs', file.replace('dist/types/src', '')), result) + await dest(join(dist, 'es', file.replace(`${dist}/types/src`, '')), result) + await dest(join(dist, 'cjs', file.replace(`${dist}/types/src`, '')), result) } - deleteAsync('dist/types') + deleteAsync(`${dist}/types`) } // 构建 UMD @@ -154,6 +156,7 @@ async function buildUMD(p) { build: { minify: false, emptyOutDir: false, + outDir: dist, rollupOptions: { external: ['react', 'react-dom'], output: [ @@ -166,7 +169,7 @@ async function buildUMD(p) { ], }, lib: { - entry: join(__dirname, '../dist/es/packages/nutui.react.build.js'), + entry: join(__dirname, `../${dist}/es/packages/nutui.react.build.js`), }, }, }) @@ -177,7 +180,7 @@ async function buildAllCSS() { async function copyStyles() { await copy( resolve(__dirname, '../src/styles'), - resolve(__dirname, '../dist/styles') + resolve(__dirname, `../${dist}/styles`) ) const content = [ @@ -190,13 +193,13 @@ async function buildAllCSS() { if (projectID) { content[1] = `@import '../variables-${projectID}.scss';` } - const scssFiles = await glob(['dist/es/packages/**/*.scss']) + const scssFiles = await glob([`${dist}/es/packages/**/*.scss`]) scssFiles.forEach((file) => { content.push( - `@import '${relativeFilePath('/dist/style.scss', '/' + file)}';` + `@import '${relativeFilePath(`/${dist}/style.scss`, '/' + file)}';` ) }) - dest('dist/style.scss', content.join('\n')) + dest(`${dist}/style.scss`, content.join('\n')) } await copyStyles() await vite.build({ @@ -206,8 +209,9 @@ async function buildAllCSS() { }, build: { emptyOutDir: false, + outDir: dist, lib: { - entry: './dist/style.scss', + entry: `./${dist}/style.scss`, formats: ['es'], name: 'style', fileName: 'style', @@ -227,13 +231,13 @@ async function buildThemeCSS() { rollupOptions: { output: [ { - dir: 'dist/styles/themes', + dir: `${dist}/styles/themes`, assetFileNames: 'default.css', }, ], }, lib: { - entry: './dist/styles/themes/default.scss', + entry: `./${dist}/styles/themes/default.scss`, }, }, }) @@ -243,7 +247,7 @@ async function buildThemeCSS() { async function copyStyles() { await copy( resolve(__dirname, '../src/styles'), - resolve(__dirname, '../dist/styles') + resolve(__dirname, `../${dist}/styles`) ) let content = [ @@ -259,7 +263,7 @@ async function copyStyles() { ] } - dest('dist/styles/themes/default.scss', content.join('\n')) + dest(`${dist}/styles/themes/default.scss`, content.join('\n')) } // 构建样式 @@ -287,12 +291,12 @@ async function buildCSS(p) { }) const cssPath = relative('src', loadPath) // 写 css 文件 - await dest(join('dist/es', cssPath, 'style/style.css'), code.css) - await dest(join('dist/es', cssPath, 'style/css.js'), `import './style.css'`) + await dest(join(`${dist}/es`, cssPath, 'style/style.css'), code.css) + await dest(join(`${dist}/es`, cssPath, 'style/css.js'), `import './style.css'`) - await dest(join('dist/cjs', cssPath, 'style/style.css'), code.css) + await dest(join(`${dist}/cjs`, cssPath, 'style/style.css'), code.css) await dest( - join('dist/cjs', cssPath, 'style/css.js'), + join(`${dist}/cjs`, cssPath, 'style/css.js'), `import './style.css'` ) @@ -319,8 +323,8 @@ async function buildCSS(p) { ]) .process(button, { from: loadPath, syntax: scss }) .then((result) => { - dest(join('dist/es', cssPath, `style/${base}`), result.css) - dest(join('dist/cjs', cssPath, `style/${base}`), result.css) + dest(join(`${dist}/es`, cssPath, `style/${base}`), result.css) + dest(join(`${dist}/cjs`, cssPath, `style/${base}`), result.css) }) const jsContent = [] @@ -339,16 +343,43 @@ async function buildCSS(p) { jsContent.push(`import './${base}';`) await dest( - join('dist/cjs', cssPath, `style/index.js`), + join(`${dist}/cjs`, cssPath, `style/index.js`), jsContent.join('\n') ) - await dest(join('dist/es', cssPath, `style/index.js`), jsContent.join('\n')) + await dest(join(`${dist}/es`, cssPath, `style/index.js`), jsContent.join('\n')) } } +function generateReleasePackageJson() { + delete packageJson.dependencies['@nutui/icons-react-taro'] + return JSON.stringify({ + name: '@nutui/nutui-react', + version: packageJson.version, + style: packageJson.style, + main: packageJson.main, + module: packageJson.module, + typings: packageJson.typings, + sideEffects: packageJson.sideEffects, + description: packageJson.description, + keywords: packageJson.keywords, + author: packageJson.author, + license: packageJson.license, + repository: packageJson.repository, + files: packageJson.files, + publishConfig: packageJson.publishConfig, + dependencies: packageJson.dependencies, + peerDependencies: packageJson.peerDependencies, + }) +} +async function copyReleaseFiles() { + const npmPublishDir = dist.replace('dist', '') + await copy(join(__dirname, '../README.md'), join(`${npmPublishDir}/README.md`)) + await copy(join(__dirname, '../CHANGELOG.md'), join(`${npmPublishDir}/CHANGELOG.md`)) + await writeFile(join(__dirname, `../${npmPublishDir}/package.json`), generateReleasePackageJson()) +} -console.time('clean dist') -await deleteAsync('dist') -console.timeEnd('clean dist') +console.time(`clean ${dist}`) +await deleteAsync(dist) +console.timeEnd(`clean ${dist}`) await generate() @@ -384,15 +415,17 @@ console.time('Build Declaration') await buildDeclaration() console.timeEnd('Build Declaration') -// await exportProps() - await deleteAsync([ - 'dist/es/packages/nutui.react.js', - 'dist/es/packages/nutui.react.d.ts', - 'dist/es/packages/nutui.react.scss.d.ts', - 'dist/es/packages/nutui.react.scss.js', + `${dist}/es/packages/nutui.react.js`, + `${dist}/es/packages/nutui.react.d.ts`, + `${dist}/es/packages/nutui.react.scss.d.ts`, + `${dist}/es/packages/nutui.react.scss.js`, ]) console.time('Build JSDoc') -codeShift() +codeShift('h5') console.timeEnd('Build JSDoc') + +console.time('Copy package.json readme.md') +await copyReleaseFiles() +console.timeEnd('Copy package.json readme.md') \ No newline at end of file diff --git a/scripts/postpublish.js b/scripts/postpublish.js deleted file mode 100644 index ab821667d4..0000000000 --- a/scripts/postpublish.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * 用于在 prepublish 之后,恢复 package.json - * */ -const path = require('path') -const fsExtra = require('fs-extra') - -fsExtra.copySync( - path.join(process.cwd(), '.cache/package.json.bk'), - path.join(process.cwd(), 'package.json'), - { overwrite: true } -) - -fsExtra.removeSync(path.join(process.cwd(), '.cache/package.json.bk')) diff --git a/scripts/prepublish.js b/scripts/prepublish.js deleted file mode 100644 index 4b8b2459e6..0000000000 --- a/scripts/prepublish.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 用于发布之前纠正 H5 和 Taro 版本的依赖 - * */ -const path = require('path') -const fsExtra = require('fs-extra') -const packageData = require('../package.json') - -const cachePath = path.join(process.cwd(), '.cache/') -if (!fsExtra.ensureDirSync(cachePath)) { - fsExtra.mkdirpSync(cachePath) -} - -fsExtra.copySync( - path.join(process.cwd(), 'package.json'), - path.join(cachePath, 'package.json.bk'), - { overwrite: true } -) - -if (packageData.name.indexOf('-taro') > -1) { - delete packageData.dependencies['@nutui/icons-react'] -} else { - delete packageData.dependencies['@nutui/icons-react-taro'] -} - -delete packageData.devDependencies -packageData.scripts = {} - -packageData.scripts['postpublish'] = 'node scripts/postpublish.js' - -fsExtra.writeJsonSync(path.join(process.cwd(), 'package.json'), packageData, { - spaces: 2, -}) From aee957fdbda91cbc8594e9f6fb8f00cef1fe7b27 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:02:48 +0800 Subject: [PATCH 02/41] chore: release package via ci --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95684fe8ff..32447f4492 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: Release -on: : +on: push: branches: - feat_v3.x. From 6a63d0f94fc9fdf117fe2041c5382729838c3798 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:03:57 +0800 Subject: [PATCH 03/41] chore: release package via ci --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32447f4492..6241641677 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - name: Install pnpm - run: npm install -g pnpm@v9. + run: npm install -g pnpm@v9 - uses: actions/setup-node@v4 with: From b1e3750fba7bf8adf26ab59bae5e9fbe06b19a38 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:05:15 +0800 Subject: [PATCH 04/41] chore: release package via ci --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6241641677..f04c2413fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install - name: Run Build run: pnpm build & pnpm build:taro From b6e32cacd53f81ec218c0578d033f227d9a49901 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:10:49 +0800 Subject: [PATCH 05/41] chore: release package via ci --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f04c2413fe..c19aba59da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: Release NPM Packages on: push: From 3c509e15c5806364604e95daa1ecd3ec9fae5b62 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:12:28 +0800 Subject: [PATCH 06/41] chore: release package via ci --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c19aba59da..70f1a62638 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: pnpm install + run: pnpm install --no-frozen-lockfile - name: Run Build run: pnpm build & pnpm build:taro From 4ee850e5fe517fbb905ccc43db4343e054b126ab Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:16:35 +0800 Subject: [PATCH 07/41] chore: release package via ci --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70f1a62638..c35cf60755 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,4 +35,4 @@ jobs: run: cd ./release/h5 && npm publish --dry-run - name: Run Releases @nutui/nutui-react-taro - run: cd ../../release/taro && npm publish --dry-run + run: cd ./release/taro && npm publish --dry-run From c29fcca2a91db408101b241771a6f64b0c22f2c3 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:24:02 +0800 Subject: [PATCH 08/41] chore: release package via ci --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ed035a274b..d03a31592d 100644 --- a/package.json +++ b/package.json @@ -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", From 123c17e0156448144c3763e3a88da021ef2e891e Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 13:56:52 +0800 Subject: [PATCH 09/41] chore: release package via ci --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c35cf60755..18be8afb55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,10 +2,8 @@ name: Release NPM Packages on: push: - branches: - - feat_v3.x. - pull_request: - types: [ opened, synchronize, reopened ] + tags: + - 'v3*' workflow_dispatch: jobs: From 7b5eb81667ef9362e6961c5802e3d7a71645b916 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:17:41 +0800 Subject: [PATCH 10/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 51 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 6 ++-- 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release-beta.yml diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml new file mode 100644 index 0000000000..d2f2b6029e --- /dev/null +++ b/.github/workflows/release-beta.yml @@ -0,0 +1,51 @@ +name: Release Beta NPM Packages + +on: + push: + branches: + - feat_v3.x + workflow_dispatch: + tags: + description: 'Publish release packages version' + required: true + default: 'beta' + type: choice + options: + - beta + - alpha + publish: + description: 'Test scenario tags' + required: false + type: boolean + +jobs: + release: + if: ${{ inputs.publish }} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_CONFIG_PROVENANCE: true + TAG: ${{ inputs.tags }} + + 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 + run: pnpm build & pnpm build:taro + + - name: Run Release @nutui/nutui-react + run: cd ./release/h5 && npm publish --dry-run --tag $TAG + + - name: Run Releases @nutui/nutui-react-taro + run: cd ./release/taro && npm publish --dry-run --tag $TAG diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18be8afb55..48c56ca065 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release NPM Packages on: push: tags: - - 'v3*' + - v3.* workflow_dispatch: jobs: @@ -30,7 +30,7 @@ jobs: run: pnpm build & pnpm build:taro - name: Run Release @nutui/nutui-react - run: cd ./release/h5 && npm publish --dry-run + run: cd ./release/h5 && npm publish - name: Run Releases @nutui/nutui-react-taro - run: cd ./release/taro && npm publish --dry-run + run: cd ./release/taro && npm publish From 59f4a3b5363326d41a9a51ceb8b9e9cae2ebf94d Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:20:56 +0800 Subject: [PATCH 11/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index d2f2b6029e..51bc9a7d67 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,9 +1,6 @@ name: Release Beta NPM Packages on: - push: - branches: - - feat_v3.x workflow_dispatch: tags: description: 'Publish release packages version' From 578ad3e5bd5be9a7fb59200a6bb2490a560ccb81 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:23:06 +0800 Subject: [PATCH 12/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 51bc9a7d67..aeeb27f4f9 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -2,18 +2,19 @@ name: Release Beta NPM Packages on: workflow_dispatch: - tags: - description: 'Publish release packages version' - required: true - default: 'beta' - type: choice - options: - - beta - - alpha - publish: - description: 'Test scenario tags' - required: false - type: boolean + inputs: + tags: + description: 'Publish release packages version' + required: true + default: 'beta' + type: choice + options: + - beta + - alpha + publish: + description: 'Test scenario tags' + required: false + type: boolean jobs: release: From d39c0f6eee50c74d0054c909cf380897c9f885ed Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:26:36 +0800 Subject: [PATCH 13/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index aeeb27f4f9..e23b7cd26b 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -12,15 +12,16 @@ on: - beta - alpha publish: - description: 'Test scenario tags' + description: 'Test scenario tags (true or false)' required: false - type: boolean + type: string + default: 'false' jobs: release: - if: ${{ inputs.publish }} + if: ${{ inputs.publish == 'true' }} env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true TAG: ${{ inputs.tags }} @@ -29,7 +30,7 @@ jobs: - uses: actions/checkout@v4 - name: Install pnpm - run: npm install -g pnpm@v9 + run: npm install -g pnpm@v9 - uses: actions/setup-node@v4 with: @@ -40,10 +41,10 @@ jobs: run: pnpm install --no-frozen-lockfile - name: Run Build - run: pnpm build & pnpm build:taro + run: pnpm build && pnpm build:taro - name: Run Release @nutui/nutui-react run: cd ./release/h5 && npm publish --dry-run --tag $TAG - name: Run Releases @nutui/nutui-react-taro - run: cd ./release/taro && npm publish --dry-run --tag $TAG + run: cd ./release/taro && npm publish --dry-run --tag $TAG \ No newline at end of file From da96a901cec9e1f6a52b61a564d852a1909ec3e5 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:29:36 +0800 Subject: [PATCH 14/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index e23b7cd26b..035521ac26 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,6 +1,9 @@ name: Release Beta NPM Packages on: + push: + branches: + - feat_v3.x workflow_dispatch: inputs: tags: From 0586197897cad999ce143e93f670917c4dfd61c8 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:30:58 +0800 Subject: [PATCH 15/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 035521ac26..ef0dafd4c8 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -4,6 +4,9 @@ on: push: branches: - feat_v3.x + pull_request: + branches: + - feat_v3.x workflow_dispatch: inputs: tags: From 4c4229674b2408eb6fb9b39ccd94bf7606097e1f Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:33:18 +0800 Subject: [PATCH 16/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index ef0dafd4c8..2d0f881199 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -25,13 +25,13 @@ on: jobs: release: - if: ${{ inputs.publish == 'true' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true TAG: ${{ inputs.tags }} runs-on: ubuntu-latest + if: ${{ inputs.publish == 'true' }} steps: - uses: actions/checkout@v4 From 761927b2f8ddc6c57c541a21152dd2a23de2bea5 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:40:46 +0800 Subject: [PATCH 17/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 2d0f881199..463ba17f6d 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -19,7 +19,7 @@ on: - alpha publish: description: 'Test scenario tags (true or false)' - required: false + required: true type: string default: 'false' From 7bebe366b2b041ebd037becbfe993b90a964a8b7 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:42:24 +0800 Subject: [PATCH 18/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 463ba17f6d..d05dcfbd90 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -24,7 +24,7 @@ on: default: 'false' jobs: - release: + release-beta: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true From bbe6ae3ccb5ddfd868e33fa6230205698ee1f861 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:45:09 +0800 Subject: [PATCH 19/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index d05dcfbd90..0cbfd39162 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,12 +1,6 @@ name: Release Beta NPM Packages on: - push: - branches: - - feat_v3.x - pull_request: - branches: - - feat_v3.x workflow_dispatch: inputs: tags: From 22cbc88832f05f2936c58f7cbdf3cf86e681bd0f Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 14:59:52 +0800 Subject: [PATCH 20/41] =?UTF-8?q?chore:=20=E6=B5=8B=E8=AF=95beta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-beta.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 0cbfd39162..f988659ae5 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,31 +1,22 @@ -name: Release Beta NPM Packages +name: Release 3x Beta NPM Packages on: - workflow_dispatch: - inputs: - tags: - description: 'Publish release packages version' - required: true - default: 'beta' - type: choice - options: - - beta - - alpha - publish: - description: 'Test scenario tags (true or false)' - required: true - type: string - default: 'false' + push: + branches: + - feat_v3.x: + pull_request: + branches: + - feat_v3.x jobs: release-beta: + if: startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true TAG: ${{ inputs.tags }} runs-on: ubuntu-latest - if: ${{ inputs.publish == 'true' }} steps: - uses: actions/checkout@v4 @@ -44,7 +35,7 @@ jobs: run: pnpm build && pnpm build:taro - name: Run Release @nutui/nutui-react - run: cd ./release/h5 && npm publish --dry-run --tag $TAG + run: cd ./release/h5 && npm publish --dry-run --tag beta - name: Run Releases @nutui/nutui-react-taro - run: cd ./release/taro && npm publish --dry-run --tag $TAG \ No newline at end of file + run: cd ./release/taro && npm publish --dry-run --tag beta \ No newline at end of file From 8412fd78dcdf9f94ca1d94e4aae8543640e629a7 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:01:50 +0800 Subject: [PATCH 21/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index f988659ae5..e070e3bc5a 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -8,6 +8,7 @@ on: branches: - feat_v3.x + jobs: release-beta: if: startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') From 17fbacb0a7332c78f5a0cea3289079c360faaacb Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:07:20 +0800 Subject: [PATCH 22/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index e070e3bc5a..0d96187f72 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -8,10 +8,9 @@ on: branches: - feat_v3.x - jobs: release-beta: - if: startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') + if: ${{ startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true From acb8b58755a5ec7ea21aafca64b5df9c03d7e8b4 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:08:20 +0800 Subject: [PATCH 23/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 0d96187f72..22bdb499c2 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -10,7 +10,7 @@ on: jobs: release-beta: - if: ${{ startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') }} + if ${{ startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true From 3a7955f8a83733e289217bd346f810ff7640deff Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:10:30 +0800 Subject: [PATCH 24/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 22bdb499c2..86a324c5ee 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -3,14 +3,17 @@ name: Release 3x Beta NPM Packages on: push: branches: - - feat_v3.x: + - feat_v3.x pull_request: branches: - feat_v3.x jobs: release-beta: - if ${{ startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') }} + if: | + github: release.event.head_commit_master != null && + startsWith(github.event.head_commit.message, 'chore(release): ') && + contains(github.event.head_commit.message, '-beta.') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true From 661b7a219abb76ecd41508cef93891f3a954e161 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:12:00 +0800 Subject: [PATCH 25/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 86a324c5ee..9df4571321 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -11,7 +11,6 @@ on: jobs: release-beta: if: | - github: release.event.head_commit_master != null && startsWith(github.event.head_commit.message, 'chore(release): ') && contains(github.event.head_commit.message, '-beta.') env: From 542c53a015fea6510fbbcdeb89625a8a89646d00 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:14:53 +0800 Subject: [PATCH 26/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 9df4571321..f2838eec51 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -11,7 +11,7 @@ on: jobs: release-beta: if: | - startsWith(github.event.head_commit.message, 'chore(release): ') && + startsWith(github.event.head_commit.message, 'chore(release):') && contains(github.event.head_commit.message, '-beta.') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From e9227b9c35a0988ddff3f39d5551eaf677aaa928 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:18:29 +0800 Subject: [PATCH 27/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index f2838eec51..69713fd953 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -10,9 +10,9 @@ on: jobs: release-beta: - if: | - startsWith(github.event.head_commit.message, 'chore(release):') && - contains(github.event.head_commit.message, '-beta.') +# if: | +# startsWith(github.event.head_commit.message, 'chore(release):') && +# contains(github.event.head_commit.message, '-beta.') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true @@ -20,6 +20,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: echo + run: | + echo "Message: ${{ github.event.head_commit.message }}" + echo "startsWith(github.event.head_commit.message, 'chore(release):') : ${{ startsWith(github.event.head_commit.message, 'chore(release):') }}" + echo "contains(github.event.head_commit.message, '-beta.') : ${{ contains(github.event.head_commit.message, '-beta.') }}" + - uses: actions/checkout@v4 - name: Install pnpm From 8eec51fcbfd33365ff1ba452ed7b9f927f3609a6 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:28:00 +0800 Subject: [PATCH 28/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 69713fd953..a045bf02cd 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -22,6 +22,7 @@ jobs: steps: - name: echo run: | + echo "${{toJSON(github.event)}}" echo "Message: ${{ github.event.head_commit.message }}" echo "startsWith(github.event.head_commit.message, 'chore(release):') : ${{ startsWith(github.event.head_commit.message, 'chore(release):') }}" echo "contains(github.event.head_commit.message, '-beta.') : ${{ contains(github.event.head_commit.message, '-beta.') }}" From 6c8a8392f61a23ae817be4745ec2644f5c71b78d Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:33:00 +0800 Subject: [PATCH 29/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index a045bf02cd..225df2f634 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -22,7 +22,7 @@ jobs: steps: - name: echo run: | - echo "${{toJSON(github.event)}}" + echo "${{toJSON(github)}}" echo "Message: ${{ github.event.head_commit.message }}" echo "startsWith(github.event.head_commit.message, 'chore(release):') : ${{ startsWith(github.event.head_commit.message, 'chore(release):') }}" echo "contains(github.event.head_commit.message, '-beta.') : ${{ contains(github.event.head_commit.message, '-beta.') }}" From 38beddf41dc7343c7b4511efc3ec626f1e27c617 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:39:14 +0800 Subject: [PATCH 30/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 225df2f634..6dbdc01fe8 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -10,22 +10,26 @@ on: jobs: release-beta: -# if: | -# startsWith(github.event.head_commit.message, 'chore(release):') && -# contains(github.event.head_commit.message, '-beta.') env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true - TAG: ${{ inputs.tags }} runs-on: ubuntu-latest steps: - - name: echo + - name: Get commit message run: | - echo "${{toJSON(github)}}" - echo "Message: ${{ github.event.head_commit.message }}" - echo "startsWith(github.event.head_commit.message, 'chore(release):') : ${{ startsWith(github.event.head_commit.message, 'chore(release):') }}" - echo "contains(github.event.head_commit.message, '-beta.') : ${{ contains(github.event.head_commit.message, '-beta.') }}" + COMMIT_MESSAGE=$(git log --format=%s -n 1) + echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV + - name: Show commit message + run: echo "$COMMIT_MESSAGE" + + - name: Commit message compliance verification + if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true + run: echo "ABORT=true" >> $GITHUB_ENV + + - name: Get Tag message + if: contains( env.COMMIT_MESSAGE , '-beta') + run: echo "RELEASE_TAG=beta" >> $GITHUB_ENV - uses: actions/checkout@v4 @@ -38,13 +42,17 @@ jobs: cache: 'pnpm' - name: Install dependencies + if: env.ABORT != 'true' run: pnpm install --no-frozen-lockfile - name: Run Build + if: env.ABORT != 'true' run: pnpm build && pnpm build:taro - name: Run Release @nutui/nutui-react + if: env.ABORT != 'true' run: cd ./release/h5 && npm publish --dry-run --tag beta - name: Run Releases @nutui/nutui-react-taro + if: env.ABORT != 'true' run: cd ./release/taro && npm publish --dry-run --tag beta \ No newline at end of file From 46cf9e861be9eaed89cf87a1331e0542d370d92a Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:44:04 +0800 Subject: [PATCH 31/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 6dbdc01fe8..312d79032d 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -16,10 +16,12 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Get commit message run: | - COMMIT_MESSAGE=$(git log --format=%s -n 1) - echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV + COMMIT_MESSAGE=$(git log --format=%s -n 1) + echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV - name: Show commit message run: echo "$COMMIT_MESSAGE" @@ -31,8 +33,6 @@ jobs: if: contains( env.COMMIT_MESSAGE , '-beta') run: echo "RELEASE_TAG=beta" >> $GITHUB_ENV - - uses: actions/checkout@v4 - - name: Install pnpm run: npm install -g pnpm@v9 From 959019b9219b23f28d00bac0a8de59c02cba3c32 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:45:04 +0800 Subject: [PATCH 32/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 312d79032d..5054ae5aa7 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -26,7 +26,7 @@ jobs: run: echo "$COMMIT_MESSAGE" - name: Commit message compliance verification - if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true + if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true && contains( env.COMMIT_MESSAGE , '-beta' ) != true run: echo "ABORT=true" >> $GITHUB_ENV - name: Get Tag message From efea6cd16f76c437d38161dde616084a839060e4 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:52:18 +0800 Subject: [PATCH 33/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 5054ae5aa7..ce4a18f851 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -17,6 +17,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Get commit message run: | From 4798d00e071554b18a8429dbf5556d2c0d4bab28 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:56:03 +0800 Subject: [PATCH 34/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index ce4a18f851..5ffd2072bb 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -19,6 +19,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} - name: Get commit message run: | From 3e3b0d923915820785a1d05d894e2bf1899eecbd Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 15:59:19 +0800 Subject: [PATCH 35/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 5ffd2072bb..99d7e4550a 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,9 +1,6 @@ name: Release 3x Beta NPM Packages on: - push: - branches: - - feat_v3.x pull_request: branches: - feat_v3.x From e4a8d587983eec83e8e5e87ae12151a644fe4da2 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 11 Feb 2025 16:11:15 +0800 Subject: [PATCH 36/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 9 +++++---- .github/workflows/release.yml | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 99d7e4550a..d6d91d2689 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,12 +1,13 @@ -name: Release 3x Beta NPM Packages +name: Release 3x Beta on: - pull_request: +# pull_request: + push: branches: - feat_v3.x jobs: - release-beta: + release-3.x-beta: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true @@ -16,7 +17,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} +# ref: ${{ github.event.pull_request.head.sha }} - name: Get commit message run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48c56ca065..ffe175b12f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release NPM Packages +name: Release 3.x on: push: @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - release: + release-3.x: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NPM_CONFIG_PROVENANCE: true From 0419a9fc968c80645dad2cb9e64742ba15492dbe Mon Sep 17 00:00:00 2001 From: oasis Date: Thu, 13 Feb 2025 10:30:44 +0800 Subject: [PATCH 37/41] fix: review --- .github/workflows/release-beta.yml | 39 ++++++++++++++++++++++++------ .github/workflows/release.yml | 27 ++++++++++++++++++--- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index d6d91d2689..c1c4e03755 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,33 +1,38 @@ name: Release 3x Beta on: -# pull_request: - push: + pull_request: +# push: branches: - feat_v3.x + workflow_dispatch: jobs: release-3.x-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 }} + ref: ${{ github.event.pull_request.head.sha }} - name: Get commit message run: | COMMIT_MESSAGE=$(git log --format=%s -n 1) - echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV + 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):' ) != true && contains( env.COMMIT_MESSAGE , '-beta' ) != true + if: | + !startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) || + !contains( env.COMMIT_MESSAGE , '-beta' ) run: echo "ABORT=true" >> $GITHUB_ENV - name: Get Tag message @@ -48,12 +53,30 @@ jobs: - name: Run Build if: env.ABORT != 'true' - run: pnpm build && pnpm build:taro + 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 && npm publish --dry-run --tag beta + 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 && npm publish --dry-run --tag beta \ No newline at end of file + run: | + cd ./release/taro || exit 1 + if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then + echo "发布 @nutui/nutui-react-taro 失败" + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffe175b12f..26bcf19791 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,10 +27,31 @@ jobs: run: pnpm install --no-frozen-lockfile - name: Run Build - run: pnpm build & pnpm build:taro + 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 - run: cd ./release/h5 && npm publish + 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 - run: cd ./release/taro && npm publish + 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 From d5b1d9d7a8677b33b71215fc97761f18798a624c Mon Sep 17 00:00:00 2001 From: oasis Date: Thu, 13 Feb 2025 10:33:38 +0800 Subject: [PATCH 38/41] fix: review --- .github/workflows/release-beta.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index c1c4e03755..6f7f12ac8e 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - release-3.x-beta: + release-3x-beta: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26bcf19791..4c0405f915 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - release-3.x: + release-3x: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NPM_CONFIG_PROVENANCE: true From 8f16ceaee503a28f4c805d983d5391b55b0e212d Mon Sep 17 00:00:00 2001 From: oasis Date: Thu, 13 Feb 2025 10:37:54 +0800 Subject: [PATCH 39/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 6f7f12ac8e..cb7d768a1e 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -2,6 +2,7 @@ name: Release 3x Beta on: pull_request: +# # push: branches: - feat_v3.x From d38799723514ae175254c86051522faef5f94aaf Mon Sep 17 00:00:00 2001 From: oasis Date: Thu, 13 Feb 2025 10:41:35 +0800 Subject: [PATCH 40/41] chore(release): v3.0.0-beta.12 --- .github/workflows/release-beta.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index cb7d768a1e..6bcef51922 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -1,9 +1,8 @@ name: Release 3x Beta on: - pull_request: -# -# push: +# pull_request: + push: branches: - feat_v3.x workflow_dispatch: @@ -20,7 +19,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} +# ref: ${{ github.event.pull_request.head.sha }} - name: Get commit message run: | From 27dd1f91da0d82a211be23b2191a8e1a5839ab72 Mon Sep 17 00:00:00 2001 From: oasis Date: Thu, 13 Feb 2025 10:48:23 +0800 Subject: [PATCH 41/41] chore: remove --dry-run --- .github/workflows/release-beta.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 6bcef51922..e60387b7e8 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -67,7 +67,7 @@ jobs: if: env.ABORT != 'true' run: | cd ./release/h5 || exit 1 - if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then + if ! npm publish --tag ${{ env.RELEASE_TAG }}; then echo "发布 @nutui/nutui-react 失败" exit 1 fi @@ -76,7 +76,7 @@ jobs: if: env.ABORT != 'true' run: | cd ./release/taro || exit 1 - if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then + if ! npm publish --tag ${{ env.RELEASE_TAG }}; then echo "发布 @nutui/nutui-react-taro 失败" exit 1 fi \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c0405f915..f2088b3a85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: if: env.ABORT != 'true' run: | cd ./release/h5 || exit 1 - if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then + if ! npm publish --tag ${{ env.RELEASE_TAG }}; then echo "发布 @nutui/nutui-react 失败" exit 1 fi @@ -51,7 +51,7 @@ jobs: if: env.ABORT != 'true' run: | cd ./release/taro || exit 1 - if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then + if ! npm publish --tag ${{ env.RELEASE_TAG }}; then echo "发布 @nutui/nutui-react-taro 失败" exit 1 fi