-
Notifications
You must be signed in to change notification settings - Fork 0
237 lines (197 loc) · 6.35 KB
/
create_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
230
231
232
233
234
235
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: APrint Java CI
on:
push:
# Sequence of patterns matched against refs/heads
#branches:
# - master
# - 'releases/**'
# Sequence of patterns matched against refs/tags
tags:
- v*
jobs:
build-windows-appimage:
name: Build AppImage on Windows
runs-on: windows-latest
steps:
# SETUP BUILD ENVIRONMENT
- id: checkout-code
name: Checkout code
uses: actions/checkout@v2
- id: setup-jdk
name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build createjpackage -x test
- id: rename-files
name: Rename files
run: |
move ./bundle/build/distributions/aprint ./bundle/build/distributions/aprint-windows
# SAVE INSTALLER
- id: upload-installer
name: Upload installer
uses: actions/upload-artifact@v2
with:
path: ./bundle/build/distributions
name: windows-aprint
retention-days: 1
build-linux-appimage:
name: Build AppImage on Linux
runs-on: ubuntu-latest
steps:
# SETUP BUILD ENVIRONMENT
- id: checkout-code
name: Checkout code
uses: actions/checkout@v2
- id: setup-jdk
name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build createjpackage -x test
- id: rename-downloaded-files
name: Rename downloaded files
run: |
ls -alR ./bundle/build/distributions/
mv ./bundle/build/distributions/aprint ./bundle/build/distributions/aprint-linux
ls -alR ./bundle/build/distributions/
- name: Compress action step
uses: a7ul/tar-action@v1.1.0
id: compress_linux_bundle
with:
command: c
cwd: ./bundle/build/distributions/
files: |
./
outPath: aprint-linux.tar.gz
# SAVE INSTALLER
- id: upload-installer
name: Upload installer
uses: actions/upload-artifact@v2
with:
path: aprint-linux.tar.gz
name: aprint-linux.tar.gz
retention-days: 1
build-macos-appimage:
name: Build AppImage on MacOsX
runs-on: macos-13
steps:
# SETUP BUILD ENVIRONMENT
- id: checkout-code
name: Checkout code
uses: actions/checkout@v2
- id: setup-jdk
name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build createjpackage -x test
# compress before upload
- name: Compress action step
uses: a7ul/tar-action@v1.1.0
id: compress_macos_bundle
with:
command: c
cwd: ./bundle/build/distributions/
files: |
./
outPath: aprint-macos-13.tar.gz
# SAVE INSTALLER
- id: upload-installer
name: Upload installer
uses: actions/upload-artifact@v2
with:
path: aprint-macos-13.tar.gz
name: aprint-macos-13.tar.gz
retention-days: 1
create-release:
name: Create Release
runs-on: ubuntu-latest
needs: [build-linux-appimage, build-windows-appimage, build-macos-appimage]
steps:
# DOWNLOAD INSTALLERS
- id: download-linux-appimage
name: Download Linux appimage
uses: actions/download-artifact@v2
with:
name: aprint-linux.tar.gz
- id: download-windows-image
name: Download Windows appimage
uses: actions/download-artifact@v2
with:
name: windows-aprint
- id: download-macos-image
name: Download MacOs appimage
uses: actions/download-artifact@v2
with:
name: aprint-macos-13.tar.gz
- id: display-downloaded-files
name: display downloaded files
run: |
ls -alR .
# CREATE GITHUB RELEASE AND ADD ASSETS
- id: create-release
name: Create GitHub release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: prerelease-${{ github.ref_name }}
release_name: prerelease-${{ github.ref_name }}
draft: true
prerelease: true
- id: release-linux-appimage
name: Release Linux appimage
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: aprint-linux.tar.gz
asset_name: aprint-linux.tar.gz
asset_content_type: application/x-binary
- uses: montudor/action-zip@v1
with:
args: zip -qq -r aprint-windows.zip aprint-windows
- id: release-windows-appimage
name: Release Windows appimage
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: aprint-windows.zip
asset_name: aprint-windows.zip
asset_content_type: application/x-binary
- id: release-macos-appimage
name: Release macos appimage
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: aprint-macos-13.tar.gz
asset_name: aprint-macos-13.tar.gz
asset_content_type: application/x-binary