9
9
check_wrapper :
10
10
name : Validate Gradle Wrapper
11
11
runs-on : ubuntu-latest
12
-
13
12
steps :
14
13
- name : Clone repo
15
- uses : actions/checkout@v2
14
+ uses : actions/checkout@v3
16
15
17
16
- name : Validate Gradle Wrapper
18
17
uses : gradle/wrapper-validation-action@v1
19
18
20
19
build :
21
- name : Build artifacts and deploy preview
20
+ name : Build Jar
22
21
needs : check_wrapper
23
22
if : " !startsWith(github.event.head_commit.message, '[SKIP CI]')"
24
23
runs-on : ubuntu-latest
25
-
26
24
steps :
27
25
- name : Cancel previous runs
28
- uses : styfle/cancel-workflow-action@0.9 .0
26
+ uses : styfle/cancel-workflow-action@0.10 .0
29
27
with :
30
28
access_token : ${{ github.token }}
31
29
32
30
- name : Checkout master branch
33
- uses : actions/checkout@v2
31
+ uses : actions/checkout@v3
34
32
with :
35
33
ref : master
36
34
path : master
@@ -59,41 +57,138 @@ jobs:
59
57
dependencies-cache-enabled : true
60
58
configuration-cache-enabled : true
61
59
60
+ - name : Upload Jar
61
+ uses : actions/upload-artifact@v3
62
+ with :
63
+ name : jar
64
+ path : master/server/build/*.jar
65
+ if-no-files-found : error
66
+
67
+ - name : Upload icons
68
+ uses : actions/upload-artifact@v3
69
+ with :
70
+ name : icon
71
+ path : master/server/src/main/resources/icon
72
+ if-no-files-found : error
73
+
74
+ - name : Tar scripts dir to maintain file permissions
75
+ run : tar -cvzf scripts.tar.gz -C master/ scripts/
76
+ - name : Upload scripts.tar.gz
77
+ uses : actions/upload-artifact@v3
78
+ with :
79
+ name : scripts
80
+ path : scripts.tar.gz
81
+ if-no-files-found : error
82
+
83
+ bundle :
84
+ strategy :
85
+ fail-fast : false
86
+ matrix :
87
+ os :
88
+ - linux-x64
89
+ - linux-all
90
+ - macOS-x64
91
+ - macOS-arm64
92
+ - debian-all
93
+ - windows-x64
94
+ - windows-x86
95
+
96
+ name : Make ${{ matrix.os }} release
97
+ needs : build
98
+ runs-on : ubuntu-latest
99
+ steps :
100
+ - name : Download Jar
101
+ uses : actions/download-artifact@v3
102
+ with :
103
+ name : jar
104
+ path : server/build
105
+
106
+ - name : Download icons
107
+ uses : actions/download-artifact@v3
108
+ with :
109
+ name : icon
110
+ path : server/src/main/resources/icon
111
+
112
+ - name : Download scripts.tar.gz
113
+ uses : actions/download-artifact@v3
114
+ with :
115
+ name : scripts
116
+
117
+ - name : Make ${{ matrix.os }} release
118
+ run : |
119
+ mkdir upload
120
+ tar -xvpf scripts.tar.gz
121
+ scripts/bundler.sh -o upload/ ${{ matrix.os }}
122
+
123
+ - name : Upload ${{ matrix.os }} release
124
+ uses : actions/upload-artifact@v3
125
+ with :
126
+ name : ${{ matrix.os }}
127
+ path : upload/*
128
+ if-no-files-found : error
129
+
130
+ release :
131
+ needs : bundle
132
+ runs-on : ubuntu-latest
133
+ steps :
134
+ - uses : actions/download-artifact@v3
135
+ with :
136
+ name : jar
137
+ path : release
138
+ - uses : actions/download-artifact@v3
139
+ with :
140
+ name : linux-x64
141
+ path : release
142
+ - uses : actions/download-artifact@v3
143
+ with :
144
+ name : linux-all
145
+ path : release
146
+ - uses : actions/download-artifact@v3
147
+ with :
148
+ name : macOS-x64
149
+ path : release
150
+ - uses : actions/download-artifact@v3
151
+ with :
152
+ name : macOS-arm64
153
+ path : release
154
+ - uses : actions/download-artifact@v3
155
+ with :
156
+ name : debian-all
157
+ path : release
158
+ - uses : actions/download-artifact@v3
159
+ with :
160
+ name : windows-x64
161
+ path : release
162
+ - uses : actions/download-artifact@v3
163
+ with :
164
+ name : windows-x86
165
+ path : release
166
+
167
+ - name : Checkout Preview branch
168
+ uses : actions/checkout@v3
169
+ with :
170
+ repository : " Suwayomi/Tachidesk-Server-preview"
171
+ ref : main
172
+ path : preview
173
+ token : ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
174
+
62
175
- name : Generate Tag Name
63
176
id : GenTagName
64
177
run : |
65
- cd master/server/build
178
+ cd release
66
179
genTag=$(ls *.jar | sed -e's/Tachidesk-Server-\|.jar//g')
67
180
echo "$genTag"
68
181
echo "::set-output name=value::$genTag"
69
182
70
- - name : make bundle packages
71
- run : |
72
- cd master/scripts
73
- ./bundler.sh -o ../../master/server/build/ windows-x86
74
- ./bundler.sh -o ../../master/server/build/ windows-x64
75
- ./bundler.sh -o ../../master/server/build/ linux-all
76
- ./bundler.sh -o ../../master/server/build/ linux-x64
77
- ./bundler.sh -o ../../master/server/build/ debian-all
78
- ./bundler.sh -o ../../master/server/build/ macOS-x64
79
- ./bundler.sh -o ../../master/server/build/ macOS-arm64
80
-
81
- - name : Checkout preview branch
82
- uses : actions/checkout@v2
83
- with :
84
- repository : ' Suwayomi/Tachidesk-Server-preview'
85
- ref : main
86
- path : preview
87
- token : ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
88
-
89
183
- name : Create Tag
90
184
run : |
91
185
TAG="${{ steps.GenTagName.outputs.value }}"
92
186
echo "tag: $TAG"
93
187
cd preview
94
188
echo "{ \"latest\": \"$TAG\" }" > index.json
95
189
git add index.json
96
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
190
+ git config --global user.email \
191
+ "github-actions[bot]@users.noreply.github.com"
97
192
git config --global user.name "github-actions[bot]"
98
193
git commit -m "Updated to $TAG"
99
194
git push origin main
@@ -102,10 +197,10 @@ jobs:
102
197
git push origin $TAG
103
198
104
199
- name : Upload Preview Release
105
- uses : ncipollo/release- action@v1
200
+ uses : softprops/ action-gh-release @v1
106
201
with :
107
202
token : ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
108
- artifacts : " master/server/build/*.jar,master/server/build/*.msi,master/server/build/*.zip,master/server/build/*.tar.gz,master/server/build/*.deb "
109
- owner : " Suwayomi "
110
- repo : " Tachidesk-Server-preview "
111
- tag : ${{ steps.GenTagName.outputs.value }}
203
+ repository : " Suwayomi/Tachidesk-Server-preview "
204
+ tag_name : ${{ steps.GenTagName.outputs.value }}
205
+ files : release/*
206
+
0 commit comments