Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Mar 30, 2024
1 parent 1e3d9c7 commit d510de3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ jobs:
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
set -ex
mkdir -p ~/.ssh
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
- name: Install and Build
run: |
pnpm install --frozen-lockfile
pnpm build
# - name: Install and Build
# run: |
# pnpm install --frozen-lockfile
# pnpm build

- name: Publish
run: node scripts/publish.js
38 changes: 19 additions & 19 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ 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));
execSync(cmd, { cwd: cacheFolder });
}
// function exec(cmd) {
// console.log(chalk.dim(cmd));
// execSync(cmd, { cwd: cacheFolder });
// }
})();

0 comments on commit d510de3

Please sign in to comment.