Skip to content

chore(ci): copy generated folder to each repository #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"eslint": "8.12.0",
"execa": "5.1.1",
"folder-hash": "4.0.2",
"fs-extra": "10.0.1",
"inquirer": "8.2.2",
"jest": "27.5.1",
"js-yaml": "4.1.0",
Expand Down
4 changes: 3 additions & 1 deletion scripts/release/common.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import path from 'path';

import clientsConfig from '../../config/clients.config.json';
import config from '../../config/release.config.json';
import { getGitHubUrl, run } from '../common';
Expand Down Expand Up @@ -59,7 +61,7 @@ export async function cloneRepository({
const targetBranch = getTargetBranch(lang);

const gitHubUrl = getGitHubUrl(lang, { token: githubToken });
const tempGitDir = `${tempDir}/${lang}`;
const tempGitDir = path.resolve(tempDir, lang);
await run(`rm -rf ${tempGitDir}`);
await run(
`git clone --depth 1 --branch ${targetBranch} ${gitHubUrl} ${tempGitDir}`
Expand Down
4 changes: 3 additions & 1 deletion scripts/release/process-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fsp from 'fs/promises';

import dotenv from 'dotenv';
import execa from 'execa';
import { emptyDir, copy } from 'fs-extra';
import semver from 'semver';
import type { ReleaseType } from 'semver';

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

const clientPath = toAbsolutePath(getLanguageFolder(lang));
await run(`cp -r ${clientPath}/ ${tempGitDir}`);
await emptyDir(tempGitDir);
await copy(clientPath, tempGitDir, { preserveTimestamps: true });
Comment on lines +209 to +210
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better!


await configureGitHubAuthor(tempGitDir);
await run(`git add .`, { cwd: tempGitDir });
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10967,7 +10967,7 @@ __metadata:
languageName: node
linkType: hard

"fs-extra@npm:^10.0.1":
"fs-extra@npm:10.0.1, fs-extra@npm:^10.0.1":
version: 10.0.1
resolution: "fs-extra@npm:10.0.1"
dependencies:
Expand Down Expand Up @@ -18835,6 +18835,7 @@ __metadata:
eslint: 8.12.0
execa: 5.1.1
folder-hash: 4.0.2
fs-extra: 10.0.1
inquirer: 8.2.2
jest: 27.5.1
js-yaml: 4.1.0
Expand Down