Skip to content

Commit ff6360f

Browse files
committed
Use script instead of sshpass on Windows
1 parent 7cacb17 commit ff6360f

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,7 @@ jobs:
6969
run: |
7070
ARCH=32
7171
PLATFORM=i686
72-
pacman --verbose --noconfirm -S msys/zlib-devel dos2unix ccache rsync unzip sshpass mingw$ARCH/mingw-w64-$PLATFORM-libzip mingw$ARCH/mingw-w64-$PLATFORM-libusb mingw$ARCH/mingw-w64-$PLATFORM-zlib mingw$ARCH/mingw-w64-$PLATFORM-pkg-config
73-
74-
# https://github.com/msys2/MSYS2-packages/issues/2485 - sshpass failed with strange error
75-
- name: Get older sshpass
76-
run: |
77-
wget http://repo.msys2.org/msys/x86_64/sshpass-1.06-1-x86_64.pkg.tar.xz
78-
pacman --verbose --noconfirm -U ./sshpass-1.06-1-x86_64.pkg.tar.xz
79-
rm ./sshpass-1.06-1-x86_64.pkg.tar.xz
72+
pacman --verbose --noconfirm -S msys/zlib-devel dos2unix ccache rsync unzip mingw$ARCH/mingw-w64-$PLATFORM-libzip mingw$ARCH/mingw-w64-$PLATFORM-libusb mingw$ARCH/mingw-w64-$PLATFORM-zlib mingw$ARCH/mingw-w64-$PLATFORM-pkg-config
8073
8174
- name: Inject slug/short variables
8275
uses: rlespinasse/github-slug-action@v3.x
@@ -150,6 +143,15 @@ jobs:
150143
which g++
151144
g++ --version
152145
146+
- name: Deploy installer
147+
if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }}
148+
run: |
149+
set -x
150+
INSTALLER_PATH=$(ls -1b installer/*.sh | head -n 1)
151+
[ -r "$INSTALLER_PATH" ] || INSTALLER_PATH=/dev/null
152+
export INSTALLER_PATH
153+
{ sleep 5 ; echo "${{ secrets.DL_PASSWORD }}" ; } | timeout -k 10s 30s script -E never -q -c "rsync -ve 'ssh -vvt -o StrictHostKeyChecking=no' $INSTALLER_PATH ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-i686-installer.exe"
154+
153155
- name: QMake
154156
timeout-minutes: 1
155157
run: |
@@ -230,7 +232,11 @@ jobs:
230232

231233
- name: Deploy installer
232234
if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }}
233-
run: sshpass -p ${{ secrets.DL_PASSWORD }} rsync -ve "ssh -o StrictHostKeyChecking=no" installer/trik-studio*installer*.exe ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-i686-installer.exe
235+
run: |
236+
INSTALLER_PATH=$(ls -1b installer/trik-studio*installer*.exe | head -n 1)
237+
[ -r "$INSTALLER_PATH" ] || INSTALLER_PATH=/dev/null
238+
export INSTALLER_PATH
239+
echo "${{ secrets.DL_PASSWORD }}"| script -E never -q -c "rsync -ve 'ssh -o StrictHostKeyChecking=no' $INSTALLER_PATH ${{ secrets.DL_USERNAME }}@${{ secrets.DL_HOST }}:~/dl/ts/fresh/installer/trik-studio-${{ env.GITHUB_REF_SLUG }}-i686-installer.exe"
234240
235241
- name: Prepare for RDP connection
236242
if: false #comment this line to create RDP session

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ after_test:
232232
- bash -c "env LC_ALL=C date -u"
233233
# deployment
234234
#- ps: if ( $artifacts.Count -eq 0 ) { exit 1 }
235-
- IF "x%server%" NEQ "x" (sshpass -p %password% rsync -avze 'ssh -o StrictHostKeyChecking=no' %INSTALLER_NAME% %server%:dl/ts/fresh/installer/)
235+
- IF "x%server%" NEQ "x" ( echo %password%| script -E never -q -c "rsync -avze 'ssh -o StrictHostKeyChecking=no' %INSTALLER_NAME% %server%:dl/ts/fresh/installer/")
236236

237237
before_deploy:
238238
- ps: if ( $artifacts.Count -eq 0 ) { exit 1 }

0 commit comments

Comments
 (0)