CI: Use rsync for Windows builds

This commit is contained in:
Jonas Kvinge 2024-07-04 23:22:37 +02:00
parent 463df825f0
commit d3ee0bfdf4
1 changed files with 55 additions and 11 deletions

View File

@ -1142,11 +1142,30 @@ jobs:
working-directory: build working-directory: build
run: makensis strawberry.nsi run: makensis strawberry.nsi
- name: Upload artifacts - name: Set Upload path
uses: actions/upload-artifact@v4 id: set-upload-path
if: github.repository == 'strawberrymusicplayer/strawberry' && (github.event_name == 'release' || (github.event_name == 'push' && github.event.pull_request.head.repo.fork == false && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' || github.ref == 'refs/heads/windows')))
run: |
if [ "${{github.event_name}}" = "release" ]; then
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/stable_releases/windows/mingw" >> $GITHUB_OUTPUT
else
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/development_releases/windows/mingw" >> $GITHUB_OUTPUT
fi
- name: SSH Setup
if: steps.set-upload-path.outputs.upload_path != ''
uses: shimataro/ssh-key-action@v2
with: with:
name: windows-mingw-${{matrix.arch}}-${{matrix.buildtype}} known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}
path: build/StrawberrySetup*.exe key: ${{ secrets.SSH_KEY }}
- name: Create server path
if: steps.set-upload-path.outputs.upload_path != ''
run: ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${{steps.set-upload-path.outputs.upload_path}}
- name: rsync
if: steps.set-upload-path.outputs.upload_path != ''
run: rsync -e "ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no" -var build/StrawberrySetup*.exe ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{steps.set-upload-path.outputs.upload_path}}/
build-windows-msvc: build-windows-msvc:
@ -1171,6 +1190,10 @@ jobs:
shell: bash shell: bash
run: echo "cmake_buildtype=$(echo ${{matrix.buildtype}} | sed 's/.*/\u&/')" >> $GITHUB_ENV run: echo "cmake_buildtype=$(echo ${{matrix.buildtype}} | sed 's/.*/\u&/')" >> $GITHUB_ENV
- name: Install rsync
shell: cmd
run: choco install --no-progress rsync
- name: Cleanup PATH - name: Cleanup PATH
uses: egor-tensin/cleanup-path@v4 uses: egor-tensin/cleanup-path@v4
with: with:
@ -1432,11 +1455,34 @@ jobs:
working-directory: build working-directory: build
run: makensis strawberry.nsi run: makensis strawberry.nsi
- name: Upload artifacts - name: Set Upload path
uses: actions/upload-artifact@v4 id: set-upload-path
with: shell: bash
name: windows-msvc-${{matrix.arch}}-${{matrix.buildtype}} if: github.repository == 'strawberrymusicplayer/strawberry' && (github.event_name == 'release' || (github.event_name == 'push' && github.event.pull_request.head.repo.fork == false && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' || github.ref == 'refs/heads/windows')))
path: build/StrawberrySetup*.exe run: |
if [ "${{github.event_name}}" = "release" ]; then
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/stable_releases/windows/msvc" >> $GITHUB_OUTPUT
else
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/development_releases/windows/msvc" >> $GITHUB_OUTPUT
fi
- name: SSH Setup
if: steps.set-upload-path.outputs.upload_path != ''
shell: bash
run: |
mkdir -p ~/.ssh
echo "${{secrets.SSH_KNOWN_HOSTS}}" > ~/.ssh/known_hosts
echo "${{secrets.SSH_KEY}}" > ~/.ssh/id_rsa
- name: Create server path
if: steps.set-upload-path.outputs.upload_path != ''
shell: bash
run: ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${{steps.set-upload-path.outputs.upload_path}}
- name: rsync
if: steps.set-upload-path.outputs.upload_path != ''
shell: bash
run: rsync -e "/c/ProgramData/chocolatey/lib/rsync/tools/bin/ssh.exe -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no" -var build/StrawberrySetup*.exe ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{steps.set-upload-path.outputs.upload_path}}/
upload: upload:
@ -1448,8 +1494,6 @@ jobs:
- build-fedora - build-fedora
- build-debian - build-debian
- build-ubuntu - build-ubuntu
- build-windows-mingw
- build-windows-msvc
steps: steps:
- name: Install packages - name: Install packages
env: env: