Skip to content

Commit 898204d

Browse files
committed
ci: Add public key.
1 parent 63696b2 commit 898204d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,24 @@ jobs:
5757
NEW_SHA1=($(sha1sum $NPM_ARCHIVE))
5858
echo SHA: $OLD_SHA1 -> $NEW_SHA1
5959
echo Publishing...
60-
npm publish
61-
echo $REGISTRY_SSH_KEY > id_rsa
62-
echo "" >> id_rsa
63-
chmod 600 id_rsa
64-
ls -l id_rsa
60+
npm publish
61+
mkdir -p ~/.ssh
62+
chmod 700 ~/.ssh
63+
echo $REGISTRY_SSH_KEY > ~/.ssh/id_rsa
64+
echo $REGISTRY_SSH_PUBKEY > ~/.ssh/id_rsa.pub
65+
chmod 600 ~/.ssh/id_rsa
66+
ls -la ~/.ssh
6567
echo Getting package.json to patch...
66-
scp -v -i id_rsa -o StrictHostKeyChecking=no [email protected]:$REGISTRY_SSH_PATH/package.json package-registry.json
68+
scp -v -o StrictHostKeyChecking=no [email protected]:$REGISTRY_SSH_PATH/package.json package-registry.json
6769
cat package-registry.json
6870
sed -i 's/$OLD_SHA1/$NEW_SHA1/' package-registry.json
6971
cat package-registry.json
70-
scp -i id_rsa -o StrictHostKeyChecking=no $NPM_ARCHIVE [email protected]:$REGISTRY_SSH_PATH
71-
scp -i id_rsa -o StrictHostKeyChecking=no package-registry.json [email protected]:$REGISTRY_SSH_PATH/package.json
72-
rm id_rsa
72+
scp -o StrictHostKeyChecking=no $NPM_ARCHIVE [email protected]:$REGISTRY_SSH_PATH
73+
scp -o StrictHostKeyChecking=no package-registry.json [email protected]:$REGISTRY_SSH_PATH/package.json
74+
rm ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
7375
env:
7476
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7577
REGISTRY_SSH_KEY: ${{ secrets.REGISTRY_SSH_KEY }}
78+
REGISTRY_SSH_PUBKEY: ${{ secrets.REGISTRY_SSH_PUBKEY }}
7679
REGISTRY_SSH_USERNAME: ${{ secrets.REGISTRY_SSH_USERNAME }}
77-
REGISTRY_SSH_PATH: ${{ secrets.REGISTRY_SSH_PATH }}
80+
REGISTRY_SSH_PATH: ${{ secrets.REGISTRY_SSH_PATH }}

0 commit comments

Comments
 (0)