use sftp for uploading
This commit is contained in:
parent
cf6ca79eed
commit
d2295e738a
6 changed files with 29 additions and 10 deletions
|
@ -47,7 +47,10 @@ jobs:
|
||||||
- name: Release to server
|
- name: Release to server
|
||||||
if: github.ref == 'refs/heads/release'
|
if: github.ref == 'refs/heads/release'
|
||||||
env:
|
env:
|
||||||
|
SSH_PRIVATEKEY: ${{ secrets.SSH_PRIVATEKEY }}
|
||||||
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
|
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
|
||||||
BB_HOST: ${{ vars.BB_HOST }}
|
BB_HOST: ${{ vars.BB_HOST }}
|
||||||
|
BB_PORT: ${{ vars.BB_PORT }}
|
||||||
|
BB_PATH: ${{ vars.BB_PATH }}
|
||||||
run: bash push_file.sh Client/build/proguard/BaseBand-Broadway.jar 3849
|
run: bash push_file.sh Client/build/proguard/BaseBand-Broadway.jar 3849
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,9 @@ jobs:
|
||||||
- name: Release to server
|
- name: Release to server
|
||||||
if: github.ref == 'refs/heads/release'
|
if: github.ref == 'refs/heads/release'
|
||||||
env:
|
env:
|
||||||
|
SSH_PRIVATEKEY: ${{ secrets.SSH_PRIVATEKEY }}
|
||||||
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
|
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
|
||||||
BB_HOST: ${{ vars.BB_HOST }}
|
BB_HOST: ${{ vars.BB_HOST }}
|
||||||
|
BB_PORT: ${{ vars.BB_PORT }}
|
||||||
|
BB_PATH: ${{ vars.BB_PATH }}
|
||||||
run: bash push_file.sh Loader/build/proguard/BaseBand-Loader.jar 3848
|
run: bash push_file.sh Loader/build/proguard/BaseBand-Loader.jar 3848
|
||||||
|
|
|
@ -32,6 +32,9 @@ jobs:
|
||||||
- name: Release to server
|
- name: Release to server
|
||||||
if: github.ref == 'refs/heads/release'
|
if: github.ref == 'refs/heads/release'
|
||||||
env:
|
env:
|
||||||
|
SSH_PRIVATEKEY: ${{ secrets.SSH_PRIVATEKEY }}
|
||||||
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
|
GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }}
|
||||||
BB_HOST: ${{ vars.BB_HOST }}
|
BB_HOST: ${{ vars.BB_HOST }}
|
||||||
|
BB_PORT: ${{ vars.BB_PORT }}
|
||||||
|
BB_PATH: ${{ vars.BB_PATH }}
|
||||||
run: bash push_file.sh Server/build/libs/BaseBand-Server.jar 3847
|
run: bash push_file.sh Server/build/libs/BaseBand-Server.jar 3847
|
||||||
|
|
1
Server/upload_key.pub
Normal file
1
Server/upload_key.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFrYCr6lzT4/dza0pEse9HjToHSZRktKwQuBP6wf1FXi tudbut@TudbuT-Arch
|
14
push_file.sh
14
push_file.sh
|
@ -3,13 +3,7 @@
|
||||||
# DO NOT RUN THIS MANUALLY. PUSH TO RELEASE INSTEAD. ( <- unless there is an emergency.)
|
# DO NOT RUN THIS MANUALLY. PUSH TO RELEASE INSTEAD. ( <- unless there is an emergency.)
|
||||||
|
|
||||||
|
|
||||||
curl "https://data.tudbut.de/nc-$(uname -m)" > nc
|
echo "$SSH_PRIVATEKEY" > ssh_key
|
||||||
chmod a+rx nc
|
chmod 700 ssh_key
|
||||||
# detect nc operation for closing on EOF
|
scp -i ssh_key -P "$BB_PORT" "$1" "root@$BB_HOST:$BB_PATH"
|
||||||
NCOP="$(./nc -h 2>&1 | grep EOF | sed -E "s/.*\W(-.).*/\1/g" | head -n1)"
|
rm ssh_key
|
||||||
|
|
||||||
echo "$GPG_PRIVATEKEY" | gpg --import
|
|
||||||
(
|
|
||||||
gpg --trust-model always -sear BaseBand -u BaseBand < $1
|
|
||||||
sleep 1
|
|
||||||
) | ./nc $NCOP $BB_HOST $2
|
|
15
push_file.sh.old
Normal file
15
push_file.sh.old
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# DO NOT RUN THIS MANUALLY. PUSH TO RELEASE INSTEAD. ( <- unless there is an emergency.)
|
||||||
|
|
||||||
|
|
||||||
|
curl "https://data.tudbut.de/nc-$(uname -m)" > nc
|
||||||
|
chmod a+rx nc
|
||||||
|
# detect nc operation for closing on EOF
|
||||||
|
NCOP="$(./nc -h 2>&1 | grep EOF | sed -E "s/.*\W(-.).*/\1/g" | head -n1)"
|
||||||
|
|
||||||
|
echo "$GPG_PRIVATEKEY" | gpg --import
|
||||||
|
(
|
||||||
|
gpg --trust-model always -sear BaseBand -u BaseBand < $1
|
||||||
|
sleep 1
|
||||||
|
) | ./nc $NCOP $BB_HOST $2
|
Loading…
Add table
Reference in a new issue