Skip to content

Commit

Permalink
feat: restore the release script
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Mar 30, 2024
1 parent 38b72fa commit 83b2e30
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install and Build
run: |
pnpm install --frozen-lockfile
# pnpm build
pnpm build
- name: Publish
run: node scripts/publish.js
30 changes: 15 additions & 15 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
}

// clean cache folder
// exec('git clean -df');
exec('git clean -df');

// exec('git checkout master');
exec('git checkout master');

// // make sure branch is always up to date
// exec('git fetch origin master');
// exec('git reset --hard origin/master');
// make sure branch is always up to date
exec('git fetch origin master');
exec('git reset --hard origin/master');

// exec('git rm -rf .');
exec('git rm -rf .');

// const files = await fs.readdir(outputFolder);
// for (const file of files) {
// await fs.copy(path.join(outputFolder, file), path.join(cacheFolder, file));
// }
const files = await fs.readdir(outputFolder);
for (const file of files) {
await fs.copy(path.join(outputFolder, file), path.join(cacheFolder, file));
}

// exec('git add .');
// exec(`git config user.email "lhtan93@gmail.com"`);
// exec(`git config user.name "Github Actions"`);
// exec(`git commit -m "Built on ${String(new Date())}"`);
// exec('git push origin master');
exec('git add .');
exec(`git config user.email "lhtan93@gmail.com"`);
exec(`git config user.name "Github Actions"`);
exec(`git commit -m "Built on ${String(new Date())}"`);
exec('git push origin master');

function exec(cmd) {
console.log(chalk.dim(cmd));
Expand Down

0 comments on commit 83b2e30

Please sign in to comment.