-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (190 loc) · 6.92 KB
/
builder.yml
File metadata and controls
227 lines (190 loc) · 6.92 KB
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
# name github action
name: platform-builder
# where to run
on:
push:
branches:
# run on main branch
- main
env:
NPM_CONFIG_USERCONFIG: .github/workflows/.npmrc
NODE_AUTH_TOKEN: ${{ secrets.GPR_READ_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GPR_READ_TOKEN }}
GH_TOKEN: ${{ secrets.GPR_READ_TOKEN }}
NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
NOTARIZE_APPLE_PASS: ${{ secrets.NOTARIZE_APPLE_PASS }}
jobs:
build_react:
name: Build React
runs-on: macOS-latest
steps:
- name: Checkout React frontend
uses: actions/checkout@v2
with:
repository: CoNET-project/seguro-platform
token: ${{ secrets.GPR_READ_TOKEN }}
path: frontend/
- name: Install frontend dependencies
run: cd frontend/ && yarn install --frozen-lockfile
- name: Build React
run: cd frontend/ && yarn build:web
- name: Upload frontend artifact
uses: actions/upload-artifact@v2
with:
name: react-build
path: frontend/build/
build_mac:
name: Package MacOS
runs-on: macOS-latest
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
needs:
- build_react
steps:
- name: Checkout Main
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Download Frontend Build Artifact
uses: actions/download-artifact@v2
with:
name: react-build
path: node_modules/@conet-project/seguro-gateway/build/launcher
- name: Package for MacOS
run: yarn build:mac
- name: Get version
id: version
run: echo ::set-output name=version::$(node -p -e "require('./package.json').version")
- name: Upload MacOS Package
uses: actions/upload-artifact@v2
with:
name: Seguro-${{steps.version.outputs.version}}.dmg
path: dist/Seguro-${{steps.version.outputs.version}}.dmg
build_windows:
name: Package Windows
runs-on: windows-latest
env:
CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
needs:
- build_react
steps:
- name: Checkout Main
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Download Frontend Build Artifact
uses: actions/download-artifact@v2
with:
name: react-build
path: node_modules/@conet-project/seguro-gateway/build/launcher
- name: Package for Windows
run: yarn build:win
- name: Get version
id: version
run: echo ::set-output name=version::$(node -p -e "require('./package.json').version")
shell: bash
- name: Upload Windows Package
uses: actions/upload-artifact@v2
with:
name: Seguro-${{steps.version.outputs.version}}.exe
path: dist/Seguro-${{steps.version.outputs.version}}.exe
build_linux:
name: Package Linux
runs-on: ubuntu-latest
needs:
- build_react
steps:
- name: Checkout Main
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Download Frontend Build Artifact
uses: actions/download-artifact@v2
with:
name: react-build
path: node_modules/@conet-project/seguro-gateway/build/launcher
- name: Package for Linux
run: yarn build:lin
- name: Get version
id: version
run: echo ::set-output name=version::$(node -p -e "require('./package.json').version")
- name: Upload Linux Package
uses: actions/upload-artifact@v2
with:
name: Seguro-${{steps.version.outputs.version}}.deb
path: dist/Seguro-${{steps.version.outputs.version}}.deb
release:
name: Release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: [ build_mac, build_windows, build_linux ]
steps:
- name: Checkout Main
uses: actions/checkout@v2
- name: Get version
id: version
run: echo ::set-output name=version::$(node -p -e "require('./package.json').version")
- name: Download MacOS Package
uses: actions/download-artifact@v2
with:
name: Seguro-${{steps.version.outputs.version}}.dmg
path: builds/
- name: Download Windows Package
uses: actions/download-artifact@v2
with:
name: Seguro-${{steps.version.outputs.version}}.exe
path: builds/
- name: Download Linux Package
uses: actions/download-artifact@v2
with:
name: Seguro-${{steps.version.outputs.version}}.deb
path: builds/
- name: Release
id: create_release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
automatic_release_tag: latest
title: v${{steps.version.outputs.version}}
files: |
builds/Seguro-${{steps.version.outputs.version}}.dmg
builds/Seguro-${{steps.version.outputs.version}}.exe
builds/Seguro-${{steps.version.outputs.version}}.deb
# - name: Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# draft: false
# prerelease: false
# release_name: ${{steps.version.outputs.version}}
# tag_name: ${{github.ref}}
#
# - name: Upload MacOS Package
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: builds/Seguro-${{steps.version.outputs.version}}.dmg
# asset_name: Seguro-${{steps.version.outputs.version}}.dmg
# asset_content_type: application/x-apple-diskimage
#
# - name: Upload Windows Package
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: builds/Seguro-${{steps.version.outputs.version}}.exe
# asset_name: Seguro-${{steps.version.outputs.version}}.exe
# asset_content_type: application/octet-stream
#
# - name: Upload Linux Package
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: builds/Seguro-${{steps.version.outputs.version}}.deb
# asset_name: Seguro-${{steps.version.outputs.version}}.deb
# asset_content_type: application/vnd.debian.binary-package