@@ -71,25 +71,251 @@ jobs:
71
71
- name : Install sccache for ${{ matrix.platform }}
72
72
shell : pwsh
73
73
run : pwsh scripts/actions/install-sccache.ps1 ${{ runner.os}}
74
+
75
+ # ==============================
76
+ # Windows Build
77
+ # ==============================
78
+
74
79
- name : Install LLVM for Windows
75
80
if : matrix.platform == 'windows-latest'
76
81
run : choco install llvm
82
+
77
83
- name : Sccache statistics
78
84
run : sccache --show-stats
79
- - name : Build OpenEthereum for windows
85
+
86
+ - name : Build OpenEthereum for Windows
80
87
if : matrix.platform == 'windows-latest'
81
88
run : sh scripts/actions/build-windows.sh ${{matrix.platform}}
89
+
90
+ - name : Upload Windows build
91
+ uses : actions/upload-artifact@v2
92
+ if : matrix.platform == 'windows-latest'
93
+ with :
94
+ name : windows-artifacts
95
+ path : artifacts
96
+
97
+ # ==============================
98
+ # Linux/Macos Build
99
+ # ==============================
100
+
82
101
- name : Build OpenEthereum for ${{matrix.platform}}
83
102
if : matrix.platform != 'windows-latest'
84
103
run : sh scripts/actions/build-linux.sh ${{matrix.platform}}
104
+
105
+ - name : Upload Linux build
106
+ uses : actions/upload-artifact@v2
107
+ if : matrix.platform == 'ubuntu-16.04'
108
+ with :
109
+ name : linux-artifacts
110
+ path : artifacts
111
+
112
+ - name : Upload MacOS build
113
+ uses : actions/upload-artifact@v2
114
+ if : matrix.platform == 'macos-latest'
115
+ with :
116
+ name : macos-artifacts
117
+ path : artifacts
118
+
119
+ # ==============================
120
+ # End builds
121
+ # ==============================
122
+
85
123
- name : Stop sccache
86
124
if : always()
87
125
run : sccache --stop-server
88
- - name : Download artifact
89
- uses : actions/upload-artifact@v1
90
- with :
91
- name : ${{matrix.platform}}.artifacts.zip
92
- path : artifacts/
126
+
93
127
- name : Prepare build directory for cache
94
- shell : bash
128
+ shell : bash
95
129
run : bash scripts/actions/clean-target.sh
130
+
131
+ zip-artifacts-creator :
132
+ name : Create zip artifacts
133
+ needs : build
134
+ runs-on : ubuntu-16.04
135
+ steps :
136
+ - name : Set env
137
+ run : echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
138
+
139
+ # ==============================
140
+ # Create ZIP files
141
+ # ==============================
142
+
143
+ - name : Download Windows artifacts
144
+ uses : actions/download-artifact@v2
145
+ with :
146
+ name : windows-artifacts
147
+ path : windows-artifacts
148
+
149
+ - name : Download Linux artifacts
150
+ uses : actions/download-artifact@v2
151
+ with :
152
+ name : linux-artifacts
153
+ path : linux-artifacts
154
+
155
+ - name : Download MacOS artifacts
156
+ uses : actions/download-artifact@v2
157
+ with :
158
+ name : macos-artifacts
159
+ path : macos-artifacts
160
+
161
+ - name : Display structure of downloaded files
162
+ run : ls
163
+
164
+ - name : Create zip Linux
165
+ id : create_zip_linux
166
+ run : |
167
+ cd linux-artifacts/
168
+ zip -rT openethereum-linux-${{ env.RELEASE_VERSION }}.zip *
169
+ ls openethereum-linux-${{ env.RELEASE_VERSION }}.zip
170
+ cd ..
171
+ mv linux-artifacts/openethereum-linux-${{ env.RELEASE_VERSION }}.zip .
172
+
173
+ echo "Setting outputs..."
174
+ echo ::set-output name=LINUX_ARTIFACT::openethereum-linux-${{ env.RELEASE_VERSION }}.zip
175
+ echo ::set-output name=LINUX_SHASUM::$(shasum -a 256 openethereum-linux-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
176
+
177
+ - name : Create zip MacOS
178
+ id : create_zip_macos
179
+ run : |
180
+ cd macos-artifacts/
181
+ zip -rT openethereum-macos-${{ env.RELEASE_VERSION }}.zip *
182
+ ls openethereum-macos-${{ env.RELEASE_VERSION }}.zip
183
+ cd ..
184
+ mv macos-artifacts/openethereum-macos-${{ env.RELEASE_VERSION }}.zip .
185
+
186
+ echo "Setting outputs..."
187
+ echo ::set-output name=MACOS_ARTIFACT::openethereum-macos-${{ env.RELEASE_VERSION }}.zip
188
+ echo ::set-output name=MACOS_SHASUM::$(shasum -a 256 openethereum-macos-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
189
+
190
+ - name : Create zip Windows
191
+ id : create_zip_windows
192
+ run : |
193
+ cd windows-artifacts/
194
+ zip -rT openethereum-windows-${{ env.RELEASE_VERSION }}.zip *
195
+ ls openethereum-windows-${{ env.RELEASE_VERSION }}.zip
196
+ cd ..
197
+ mv windows-artifacts/openethereum-windows-${{ env.RELEASE_VERSION }}.zip .
198
+
199
+ echo "Setting outputs..."
200
+ echo ::set-output name=WINDOWS_ARTIFACT::openethereum-windows-${{ env.RELEASE_VERSION }}.zip
201
+ echo ::set-output name=WINDOWS_SHASUM::$(shasum -a 256 openethereum-windows-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
202
+
203
+ # ==============================
204
+ # Upload artifacts
205
+ # ==============================
206
+
207
+ - name : Upload artifacts
208
+ uses : actions/upload-artifact@v2
209
+ with :
210
+ name : openethereum-linux-${{ env.RELEASE_VERSION }}.zip
211
+ path : openethereum-linux-${{ env.RELEASE_VERSION }}.zip
212
+
213
+ - name : Upload artifacts
214
+ uses : actions/upload-artifact@v2
215
+ with :
216
+ name : openethereum-macos-${{ env.RELEASE_VERSION }}.zip
217
+ path : openethereum-macos-${{ env.RELEASE_VERSION }}.zip
218
+
219
+ - name : Upload artifacts
220
+ uses : actions/upload-artifact@v2
221
+ with :
222
+ name : openethereum-windows-${{ env.RELEASE_VERSION }}.zip
223
+ path : openethereum-windows-${{ env.RELEASE_VERSION }}.zip
224
+
225
+ outputs :
226
+ linux-artifact : ${{ steps.create_zip_linux.outputs.LINUX_ARTIFACT }}
227
+ linux-shasum : ${{ steps.create_zip_linux.outputs.LINUX_SHASUM }}
228
+ macos-artifact : ${{ steps.create_zip_macos.outputs.MACOS_ARTIFACT }}
229
+ macos-shasum : ${{ steps.create_zip_macos.outputs.MACOS_SHASUM }}
230
+ windows-artifact : ${{ steps.create_zip_windows.outputs.WINDOWS_ARTIFACT }}
231
+ windows-shasum : ${{ steps.create_zip_windows.outputs.WINDOWS_SHASUM }}
232
+
233
+ draft-release :
234
+ name : Draft Release
235
+ needs : zip-artifacts-creator
236
+ runs-on : ubuntu-16.04
237
+ steps :
238
+ - name : Set env
239
+ run : echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
240
+
241
+ # ==============================
242
+ # Download artifacts
243
+ # ==============================
244
+
245
+ - name : Download artifacts
246
+ uses : actions/download-artifact@v2
247
+ with :
248
+ name : openethereum-linux-${{ env.RELEASE_VERSION }}.zip
249
+
250
+ - name : Download artifacts
251
+ uses : actions/download-artifact@v2
252
+ with :
253
+ name : openethereum-macos-${{ env.RELEASE_VERSION }}.zip
254
+
255
+ - name : Download artifacts
256
+ uses : actions/download-artifact@v2
257
+ with :
258
+ name : openethereum-windows-${{ env.RELEASE_VERSION }}.zip
259
+
260
+ - name : Display structure of downloaded files
261
+ run : ls
262
+
263
+ # ==============================
264
+ # Create release draft
265
+ # ==============================
266
+
267
+ - name : Create Release Draft
268
+ id : create_release_draft
269
+ uses : actions/create-release@v1
270
+ env :
271
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
272
+ with :
273
+ tag_name : ${{ github.ref }}
274
+ release_name : OpenEthereum ${{ github.ref }}
275
+ body : |
276
+ This release contains <ADD_TEXT>
277
+
278
+ | System | Architecture | Binary | Sha256 Checksum |
279
+ |:---:|:---:|:---:|:---|
280
+ | <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/apple.png" alt="Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [${{ needs.zip-artifacts-creator.outputs.macos-artifact }}](https://github.com/openethereum/openethereum/releases/download/${{ env.RELEASE_VERSION }}/${{ needs.zip-artifacts-creator.outputs.macos-artifact }}) | `${{ needs.zip-artifacts-creator.outputs.macos-shasum }}` |
281
+ | <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [${{ needs.zip-artifacts-creator.outputs.linux-artifact }}](https://github.com/openethereum/openethereum/releases/download/${{ env.RELEASE_VERSION }}/${{ needs.zip-artifacts-creator.outputs.linux-artifact }}) | `${{ needs.zip-artifacts-creator.outputs.linux-shasum }}` |
282
+ | <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/windows.png" alt="Windows Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [${{ needs.zip-artifacts-creator.outputs.windows-artifact }}](https://github.com/openethereum/openethereum/releases/download/${{ env.RELEASE_VERSION }}/${{ needs.zip-artifacts-creator.outputs.windows-artifact }}) | `${{ needs.zip-artifacts-creator.outputs.windows-shasum }}` |
283
+ | | | | |
284
+ | **System** | **Option** | - | **Resource** |
285
+ | <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/settings.png" alt="Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Docker | - | [hub.docker.com/r/openethereum/openethereum](https://hub.docker.com/r/openethereum/openethereum) |
286
+
287
+ draft : true
288
+ prerelease : true
289
+
290
+ - name : Upload Release Asset - Linux
291
+ id : upload_release_asset_linux
292
+
293
+ env :
294
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
295
+ with :
296
+ upload_url : ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
297
+ asset_path : ./openethereum-linux-${{ env.RELEASE_VERSION }}.zip
298
+ asset_name : openethereum-linux-${{ env.RELEASE_VERSION }}.zip
299
+ asset_content_type : application/zip
300
+
301
+ - name : Upload Release Asset - MacOS
302
+ id : upload_release_asset_macos
303
+
304
+ env :
305
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
306
+ with :
307
+ upload_url : ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
308
+ asset_path : ./openethereum-macos-${{ env.RELEASE_VERSION }}.zip
309
+ asset_name : openethereum-macos-${{ env.RELEASE_VERSION }}.zip
310
+ asset_content_type : application/zip
311
+
312
+ - name : Upload Release Asset - Windows
313
+ id : upload_release_asset_windows
314
+ uses : actions/upload-release-asset@v1
315
+ env :
316
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
317
+ with :
318
+ upload_url : ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
319
+ asset_path : ./openethereum-windows-${{ env.RELEASE_VERSION }}.zip
320
+ asset_name : openethereum-windows-${{ env.RELEASE_VERSION }}.zip
321
+ asset_content_type : application/zip
0 commit comments