Skip to content

Commit

Permalink
[editor only] new deploy approach
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnm committed Oct 7, 2024
1 parent e57fd41 commit 74e261d
Showing 1 changed file with 12 additions and 39 deletions.
51 changes: 12 additions & 39 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
- name: Upload deb artifact
uses: actions/[email protected]
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:
Expand Down Expand Up @@ -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')"
Expand Down Expand Up @@ -150,15 +134,4 @@ jobs:
uses: actions/[email protected]
with:
name: macOS.HyperLap2D-SNAPSHOT.dmg
path: macOS.HyperLap2D-SNAPSHOT.dmg
- name: Sync files with server
uses: wlixcc/[email protected]
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'
path: macOS.HyperLap2D-SNAPSHOT.dmg

0 comments on commit 74e261d

Please sign in to comment.