-
Notifications
You must be signed in to change notification settings - Fork 67
139 lines (132 loc) · 4.8 KB
/
snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: SNAPSHOT Build
on:
push:
branches: [ master ]
jobs:
linux:
if: "!contains(github.event.head_commit.message, 'cd skip')"
runs-on: ubuntu-latest
needs: [windows, macOS]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Eclipse Temurin OpenJDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Add build info
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: |
echo "build=$WORKFLOW_RUN" >> assets/configs/app.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build JAR dist files
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew dist -PSNAPSHOT=true
- name: Build deb package
env:
WORKFLOW_RUN: ${{ github.run_number }}
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: Display structure of downloaded files
run: ls -R
- 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: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_SSH_HOST }}
username: ${{ secrets.DEPLOY_SSH_USERNAME }}
password: ${{ secrets.DEPLOY_SSH_PASSWORD }}
port: ${{ secrets.DEPLOY_SSH_PORT }}
source: "Linux.HyperLap2D-SNAPSHOT.deb,Windows.HyperLap2D-SNAPSHOT.exe/Windows.HyperLap2D-SNAPSHOT.exe,macOS.HyperLap2D-SNAPSHOT.dmg/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:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew build publish -PSNAPSHOT=true
windows:
if: "!contains(github.event.head_commit.message, 'cd skip')"
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Eclipse Temurin OpenJDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Add build info
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: |
echo "build=$Env:WORKFLOW_RUN" >> assets/configs/app.properties
- name: Build JAR dist files
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew.bat dist -PSNAPSHOT=true
- name: Build exe package
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew.bat jpackage -PSNAPSHOT=true
- name: Fix file names
run: mv build/jpackage/*.exe Windows.HyperLap2D-SNAPSHOT.exe
- name: Upload exe artifact
uses: actions/[email protected]
with:
name: Windows.HyperLap2D-SNAPSHOT.exe
path: Windows.HyperLap2D-SNAPSHOT.exe
macOS:
if: "!contains(github.event.head_commit.message, 'cd skip')"
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Eclipse Temurin OpenJDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Add build info
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: |
echo "build=$WORKFLOW_RUN" >> assets/configs/app.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build JAR dist files
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew dist -PSNAPSHOT=true
- name: Build dmg package
env:
WORKFLOW_RUN: ${{ github.run_number }}
run: ./gradlew jpackage -PSNAPSHOT=true
- name: Fix file names
run: mv build/jpackage/*.dmg macOS.HyperLap2D-SNAPSHOT.dmg
- name: Upload dmg artifact
uses: actions/[email protected]
with:
name: macOS.HyperLap2D-SNAPSHOT.dmg
path: macOS.HyperLap2D-SNAPSHOT.dmg