Skip to content

Commit e7999f5

Browse files
authored
chore(ci): copy generated folder to each repository (#301)
* chore(ci): copy generated folder to each repository * chore: move dependency * chore: fix yarn.lock
1 parent c5eab33 commit e7999f5

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"eslint": "8.12.0",
2626
"execa": "5.1.1",
2727
"folder-hash": "4.0.2",
28+
"fs-extra": "10.0.1",
2829
"inquirer": "8.2.2",
2930
"jest": "27.5.1",
3031
"js-yaml": "4.1.0",

scripts/release/common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'path';
2+
13
import clientsConfig from '../../config/clients.config.json';
24
import config from '../../config/release.config.json';
35
import { getGitHubUrl, run } from '../common';
@@ -59,7 +61,7 @@ export async function cloneRepository({
5961
const targetBranch = getTargetBranch(lang);
6062

6163
const gitHubUrl = getGitHubUrl(lang, { token: githubToken });
62-
const tempGitDir = `${tempDir}/${lang}`;
64+
const tempGitDir = path.resolve(tempDir, lang);
6365
await run(`rm -rf ${tempGitDir}`);
6466
await run(
6567
`git clone --depth 1 --branch ${targetBranch} ${gitHubUrl} ${tempGitDir}`

scripts/release/process-release.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fsp from 'fs/promises';
33

44
import dotenv from 'dotenv';
55
import execa from 'execa';
6+
import { emptyDir, copy } from 'fs-extra';
67
import semver from 'semver';
78
import type { ReleaseType } from 'semver';
89

@@ -205,7 +206,8 @@ async function processRelease(): Promise<void> {
205206
});
206207

207208
const clientPath = toAbsolutePath(getLanguageFolder(lang));
208-
await run(`cp -r ${clientPath}/ ${tempGitDir}`);
209+
await emptyDir(tempGitDir);
210+
await copy(clientPath, tempGitDir, { preserveTimestamps: true });
209211

210212
await configureGitHubAuthor(tempGitDir);
211213
await run(`git add .`, { cwd: tempGitDir });

yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10967,7 +10967,7 @@ __metadata:
1096710967
languageName: node
1096810968
linkType: hard
1096910969

10970-
"fs-extra@npm:^10.0.1":
10970+
"fs-extra@npm:10.0.1, fs-extra@npm:^10.0.1":
1097110971
version: 10.0.1
1097210972
resolution: "fs-extra@npm:10.0.1"
1097310973
dependencies:
@@ -18835,6 +18835,7 @@ __metadata:
1883518835
eslint: 8.12.0
1883618836
execa: 5.1.1
1883718837
folder-hash: 4.0.2
18838+
fs-extra: 10.0.1
1883818839
inquirer: 8.2.2
1883918840
jest: 27.5.1
1884018841
js-yaml: 4.1.0

0 commit comments

Comments
 (0)