diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index dfdb6e47..fee836aa 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -11,7 +11,7 @@ jobs: linux: if: "!contains(github.event.head_commit.message, 'cd skip')" runs-on: ubuntu-latest - + needs: [windows, macOS] steps: - uses: actions/checkout@v2 with: @@ -38,34 +38,27 @@ jobs: run: ./gradlew jpackage -PSNAPSHOT=true - name: Fix deb file names run: mv build/jpackage/*.deb Linux.HyperLap2D-SNAPSHOT.deb + - name: Generate build info + env: + WORKFLOW_RUN: ${{ github.run_number }} + run: | + echo "{ \"build\": $WORKFLOW_RUN }" > snapshot.json + - name: Download macOS and Windows Release + uses: actions/download-artifact@v4.1.8 - name: Upload deb artifact uses: actions/upload-artifact@v4.4.0 with: name: Linux.HyperLap2D-SNAPSHOT.deb path: Linux.HyperLap2D-SNAPSHOT.deb - name: Sync files with production server - uses: garygrossgarten/github-action-scp@release + uses: appleboy/scp-action@v0.1.7 with: host: ${{ secrets.DEPLOY_SSH_HOST }} username: ${{ secrets.DEPLOY_SSH_USERNAME }} password: ${{ secrets.DEPLOY_SSH_PASSWORD }} port: ${{ secrets.DEPLOY_SSH_PORT }} - local: "Linux.HyperLap2D-SNAPSHOT.deb" - remote: ${{ format('{0}/{1}', secrets.DEPLOY_SSH_TARGET_PATH, 'Linux.HyperLap2D-SNAPSHOT.deb') }} - - name: Generate build info - env: - WORKFLOW_RUN: ${{ github.run_number }} - run: | - echo "{ \"build\": $WORKFLOW_RUN }" > snapshot.json - - name: Sync build info with production server - uses: garygrossgarten/github-action-scp@release - with: - host: ${{ secrets.DEPLOY_SSH_HOST }} - username: ${{ secrets.DEPLOY_SSH_USERNAME }} - password: ${{ secrets.DEPLOY_SSH_PASSWORD }} - port: ${{ secrets.DEPLOY_SSH_PORT }} - local: "snapshot.json" - remote: ${{ format('{0}/{1}', secrets.DEPLOY_SSH_TARGET_PATH, 'snapshot.json') }} + source: "Linux.HyperLap2D-SNAPSHOT.deb,Windows.HyperLap2D-SNAPSHOT.exe,macOS.HyperLap2D-SNAPSHOT.dmg",snapshot.json + target: ${{ secrets.DEPLOY_SSH_TARGET_PATH }} - name: Publish SNAPSHOT artifacts if: "!contains(github.event.head_commit.message, 'editor only')" env: @@ -106,15 +99,6 @@ jobs: with: name: Windows.HyperLap2D-SNAPSHOT.exe path: Windows.HyperLap2D-SNAPSHOT.exe - - name: Sync files with server - uses: garygrossgarten/github-action-scp@release - with: - host: ${{ secrets.DEPLOY_SSH_HOST }} - username: ${{ secrets.DEPLOY_SSH_USERNAME }} - password: ${{ secrets.DEPLOY_SSH_PASSWORD }} - port: ${{ secrets.DEPLOY_SSH_PORT }} - local: "Windows.HyperLap2D-SNAPSHOT.exe" - remote: ${{ format('{0}/{1}', secrets.DEPLOY_SSH_TARGET_PATH, 'Windows.HyperLap2D-SNAPSHOT.exe') }} macOS: if: "!contains(github.event.head_commit.message, 'cd skip')" @@ -150,15 +134,4 @@ jobs: uses: actions/upload-artifact@v4.4.0 with: name: macOS.HyperLap2D-SNAPSHOT.dmg - path: macOS.HyperLap2D-SNAPSHOT.dmg - - name: Sync files with server - uses: wlixcc/SFTP-Deploy-Action@v1.2.4 - with: - server: ${{ secrets.DEPLOY_SSH_HOST }} - username: ${{ secrets.DEPLOY_SSH_USERNAME }} - password: ${{ secrets.DEPLOY_SSH_PASSWORD }} - port: ${{ secrets.DEPLOY_SSH_PORT }} - local_path: "macOS.HyperLap2D-SNAPSHOT.dmg" - remote_path: ${{ format('{0}/{1}', secrets.DEPLOY_SSH_TARGET_PATH, 'macOS.HyperLap2D-SNAPSHOT.dmg') }} - ssh_private_key: "" - sftpArgs: '-o ConnectTimeout=15' \ No newline at end of file + path: macOS.HyperLap2D-SNAPSHOT.dmg \ No newline at end of file