-
Notifications
You must be signed in to change notification settings - Fork 6
229 lines (215 loc) · 8.54 KB
/
release.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: Publish release
on:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- v[0-9].[0-9]+.[0-9]+
jobs:
publish-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
java-package: jdk+fx
- uses: azure/docker-login@v1
if: contains(github.ref, '/tags/')
with:
username: karasiq
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.sbt/boot
~/.cache/coursier
**/target
key: shadowcloud-target-${{ hashFiles('**/src/main/**/*.scala', 'build.sbt', 'project/*.scala', 'project/*.sbt') }}
restore-keys: |
shadowcloud-target-
- name: Publish docker image
run: |
export JAVA_OPTS="-Xmx4G -Denable-tika=1 -Denable-javacv=1"
if [[ "${{ github.ref }}" == *"/tags"* ]]; then
sbt consoleApp/docker:publish
else
sbt consoleApp/docker:publishLocal
fi
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get version
id: version
run: |
git fetch --prune --unshallow
git checkout master
GitMessage=$(git log -1 --pretty=%B)
VersionMsgRegex='Version ([0-9]+\.[0-9]+\.?[0-9]*).*'
if [[ $GitMessage =~ $VersionMsgRegex ]]; then
Version="${BASH_REMATCH[1]}"
else
VersionTag=$(git describe --tags --abbrev=0)
Version="${VersionTag:1}"
fi
echo "::set-output name=version::$Version"
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
java-package: jdk+fx
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.sbt/boot
~/.cache/coursier
**/target
key: shadowcloud-target-${{ hashFiles('**/src/main/**/*.scala', 'build.sbt', 'project/*.scala', 'project/*.sbt') }}
restore-keys: |
shadowcloud-target-
- name: Package DEB
run: |
Version="${{steps.version.outputs.version}}"
Universal="${{github.workspace}}/desktop-app/target/universal"
JPBundles="$Universal/jdkpackager/bundles"
JAVA_OPTS="-Xmx4G -Denable-tika=1 -Denable-javacv-all=1" sbt desktopApp/universal:packageBin
mv "$Universal/shadowcloud-$Version.zip" "$Universal/shadowcloud-full-$Version.zip"
JAVA_OPTS="-Xmx4G -Denable-tika=1 -Denable-javacv=1" sbt desktopApp/jdkPackager:packageBin
mv "$JPBundles/shadowcloud-$Version.deb" "$JPBundles/shadowcloud-full-$Version.deb"
mv "$JPBundles/shadowcloud-$Version-1.x86_64.rpm" "$JPBundles/shadowcloud-full-$Version-1.x86_64.rpm"
JAVA_OPTS="-Xmx4G -Denable-tika=0 -Denable-javacv=0" sbt desktopApp/jdkPackager:packageBin desktopApp/universal:packageBin
mv "$JPBundles/shadowcloud-$Version.deb" "$JPBundles/shadowcloud-light-$Version.deb"
mv "$JPBundles/shadowcloud-$Version-1.x86_64.rpm" "$JPBundles/shadowcloud-light-$Version-1.x86_64.rpm"
mv "$Universal/shadowcloud-$Version.zip" "$Universal/shadowcloud-light-$Version.zip"
- name: Release
if: contains(github.ref, '/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
${{github.workspace}}/desktop-app/target/universal/*.zip
${{github.workspace}}/desktop-app/target/universal/jdkpackager/bundles/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
run: |
rm -f "${{github.workspace}}/desktop-app/target/universal/jdkpackager/bundles/*"
rm -f "${{github.workspace}}/desktop-app/target/universal/*.zip"
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Get version
id: version
run: |
git fetch --prune --unshallow
git checkout master
$GitMessage = (git log -1 --pretty=%B) | Out-String
$VersionMsgRegex = "Version ([0-9]+\.[0-9]+\.?[0-9]*)\s*"
if ($GitMessage -match $VersionMsgRegex) {
$Version = $Matches[1]
} else {
$VersionTag = (git describe --tags --abbrev=0) | Out-String
$Version = $VersionTag.SubString(1)
}
Write-Output "::set-output name=version::$Version"
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
java-package: jdk+fx
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.sbt/boot
~/.cache/coursier
**/target
key: shadowcloud-target-${{ hashFiles('**/src/main/**/*.scala', 'build.sbt', 'project/*.scala', 'project/*.sbt') }}
restore-keys: |
shadowcloud-target-
- name: Package EXE
run: |
choco uninstall -y InnoSetup
choco install -y InnoSetup --version=5.6.1
$Version="${{steps.version.outputs.version}}"
$Universal="desktop-app\target\universal"
$JPBundles="$Universal\jdkpackager\bundles"
Remove-Item "$JPBundles\*" -ErrorAction SilentlyContinue
$env:JAVA_OPTS="-Xmx4G -Denable-tika=1 -Denable-javacv=1"
sbt desktopApp/jdkPackager:packageBin
move "$JPBundles\shadowcloud-$Version.exe" "$JPBundles\shadowcloud-full-$Version.exe"
$env:JAVA_OPTS="-Xmx4G -Denable-tika=0 -Denable-javacv=0"
sbt desktopApp/jdkPackager:packageBin
move "$JPBundles\shadowcloud-$Version.exe" "$JPBundles\shadowcloud-light-$Version.exe"
- name: Release
if: contains(github.ref, '/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
${{github.workspace}}/desktop-app/target/universal/jdkpackager/bundles/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
run: |
Remove-Item "${{github.workspace}}\desktop-app\target\universal\jdkpackager\bundles\*" -ErrorAction SilentlyContinue
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Get version
id: version
run: |
git fetch --prune --unshallow
git checkout master
export GitMessage=$(git log -1 --pretty=%B)
VersionMsgRegex='Version ([0-9]+\.[0-9]+\.?[0-9]*).*'
if [[ $GitMessage =~ $VersionMsgRegex ]]; then
export Version="${BASH_REMATCH[1]}"
else
export VersionTag=$(git describe --tags --abbrev=0)
export Version="${VersionTag:1}"
fi
echo "::set-output name=version::$Version"
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.sbt/boot
~/.cache/coursier
**/target
key: shadowcloud-target-${{ hashFiles('**/src/main/**/*.scala', 'build.sbt', 'project/*.scala', 'project/*.sbt') }}
restore-keys: |
shadowcloud-target-
- name: Package PKG
run: |
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 8.0.272.fx-zulu
sdk install sbt 1.3.8
sdk use java 8.0.272.fx-zulu
sdk use sbt 1.3.8
Version="${{steps.version.outputs.version}}"
Universal="${{github.workspace}}/desktop-app/target/universal"
JPBundles="$Universal/jdkpackager/bundles"
JAVA_OPTS="-Xmx4G -Denable-tika=0 -Denable-javacv=0" sbt "set jdkPackagerType in desktopApp :=\"pkg\"" desktopApp/jdkPackager:packageBin
mv "$JPBundles/shadowcloud-$Version.pkg" "$JPBundles/shadowcloud-light-$Version.pkg"
JAVA_OPTS="-Xmx4G -Denable-tika=1 -Denable-javacv=1" sbt "set jdkPackagerType in desktopApp :=\"pkg\"" desktopApp/jdkPackager:packageBin
mv "$JPBundles/shadowcloud-$Version.pkg" "$JPBundles/shadowcloud-full-$Version.pkg"
- name: Release
if: contains(github.ref, '/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
${{github.workspace}}/desktop-app/target/universal/jdkpackager/bundles/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
run: |
rm -f "${{github.workspace}}/desktop-app/target/universal/jdkpackager/bundles/*"