-
Notifications
You must be signed in to change notification settings - Fork 67
162 lines (154 loc) · 5.89 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# 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
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: Upload deb artifact
uses: actions/upload-artifact@v2
with:
name: Linux.HyperLap2D-SNAPSHOT.deb
path: Linux.HyperLap2D-SNAPSHOT.deb
- name: Sync files 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: "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') }}
- 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/upload-artifact@v2
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')"
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/upload-artifact@v2
with:
name: macOS.HyperLap2D-SNAPSHOT.dmg
path: macOS.HyperLap2D-SNAPSHOT.dmg
- 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: "macOS.HyperLap2D-SNAPSHOT.dmg"
remote: ${{ format('{0}/{1}', secrets.DEPLOY_SSH_TARGET_PATH, 'macOS.HyperLap2D-SNAPSHOT.dmg') }}