Skip to content

Commit ae84180

Browse files
authored
chore: fix aur publish script (#53)
1 parent fec1a65 commit ae84180

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.changes/fix-aur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"algohub": patch:fix
3+
---
4+
5+
Fix git ssh key read and write permission issue when publishing to AUR.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ components.d.ts
2828

2929
# Tailwind CSS
3030
tailwind.css
31+
32+
# Autogenerated files
33+
.aur_ssh_key

scripts/release-aur.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,18 @@ const releaseAur = defineCommand({
6868
return;
6969
}
7070

71-
writeFileSync(`${process.env.HOME}/.ssh/aur`, AUR_SSH_KEY + "\n");
72-
execSync("chmod 600 ~/.ssh/aur");
73-
execSync(`git -C aur config core.sshCommand "ssh -i ~/.ssh/aur"`);
74-
71+
writeFileSync(`.aur_ssh_key`, AUR_SSH_KEY + "\n");
72+
execSync(`chmod 400 .aur_ssh_key`)
7573
if (!existsSync("aur")) {
7674
execSync(
77-
`git -c init.defaultBranch=master -c core.sshCommand="ssh -i ~/.ssh/aur" clone ssh://aur@aur.archlinux.org/algohub.git aur`
75+
`git -c init.defaultBranch=master -c core.sshCommand="ssh -i ../.aur_ssh_key" clone ssh://aur@aur.archlinux.org/algohub.git aur`
7876
);
7977
}
78+
execSync(`git -C aur config core.sshCommand "ssh -i ../.aur_ssh_key"`);
8079

8180
const { version } = ctx.args;
8281

8382
const url = `https://github.com/swpu-acm/algohub/releases/download/algohub-v${version}/algohub_${version}_amd64.deb`;
84-
// const url = `https://github.com/swpu-acm/algohub/releases/download/algohub-v${version}/algohub_0.1.0_amd64.deb`;
8583
try {
8684
console.log(`Downloading ${url}...`);
8785
const response = await axios.get(url, {

0 commit comments

Comments
 (0)