Skip to content

Commit

Permalink
Use script instead of sshpass on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov committed Feb 11, 2023
1 parent 7cacb17 commit cd7a4ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ jobs:
run: |
ARCH=32
PLATFORM=i686
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
# https://github.com/msys2/MSYS2-packages/issues/2485 - sshpass failed with strange error
- name: Get older sshpass
run: |
wget http://repo.msys2.org/msys/x86_64/sshpass-1.06-1-x86_64.pkg.tar.xz
pacman --verbose --noconfirm -U ./sshpass-1.06-1-x86_64.pkg.tar.xz
rm ./sshpass-1.06-1-x86_64.pkg.tar.xz
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
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
Expand Down Expand Up @@ -150,6 +143,15 @@ jobs:
which g++
g++ --version
- name: Deploy installer
if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }}
run: |
set -x
INSTALLER_PATH=$(ls -1b installer/*.sh | head -n 1)
[ -r "$INSTALLER_PATH" ] || INSTALLER_PATH=/dev/null
export INSTALLER_PATH
{ sleep 5 ; echo "${{ secrets.DL_PASSWORD }}" ; } | timeout -k 10s --foreground 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"
- name: QMake
timeout-minutes: 1
run: |
Expand Down Expand Up @@ -230,7 +232,11 @@ jobs:

- name: Deploy installer
if: ${{ matrix.deploy-installer && github.event_name != 'pull_request' && github.repository_owner == 'trikset' }}
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
run: |
INSTALLER_PATH=$(ls -1b installer/trik-studio*installer*.exe | head -n 1)
[ -r "$INSTALLER_PATH" ] || INSTALLER_PATH=/dev/null
export INSTALLER_PATH
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"
- name: Prepare for RDP connection
if: false #comment this line to create RDP session
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ after_test:
- bash -c "env LC_ALL=C date -u"
# deployment
#- ps: if ( $artifacts.Count -eq 0 ) { exit 1 }
- IF "x%server%" NEQ "x" (sshpass -p %password% rsync -avze 'ssh -o StrictHostKeyChecking=no' %INSTALLER_NAME% %server%:dl/ts/fresh/installer/)
- 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/")

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

0 comments on commit cd7a4ab

Please sign in to comment.