-
Notifications
You must be signed in to change notification settings - Fork 6
197 lines (179 loc) · 5.93 KB
/
build.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
on:
push:
tags:
- '*'
#branches:
#- '*'
pull_request:
branches:
- '*'
# repository_dispatch is a newer github-actions feature that will allow building from triggers other than code merge/PR
repository_dispatch:
types: [build]
name: Build Nemesis
jobs:
build:
timeout-minutes: 40
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ubuntu-20.04, macos-11, windows-2016]
continue-on-error: false
steps:
- name: git checkout
uses: actions/checkout@master
continue-on-error: false
- name: get tag & short-sha
run: |
echo "REVISION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
continue-on-error: true
- name: setup node
uses: actions/setup-node@master
with:
node-version: '12'
continue-on-error: false
# for debugging
- name: show variables
run: |
echo "Build: ${{ github.RUN_NUMBER }}"
echo "Commit: ${{ github.SHA }}"
echo "Short: ${{ env.SHORT_SHA }}"
echo "Ref: ${{ github.REF}}"
echo "Tag: ${{ env.REVISION_TAG }}"
echo "Actor: ${{ github.ACTOR }}"
echo "Repo: ${{ github.REPOSITORY }}"
continue-on-error: true
- name: Build-Setup Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }}
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -rf ./build/
rm -rf ./dist/
npm install -g npm@6
npm config set python /usr/bin/python2.7
npm install -g n
sudo n 12
npm install [email protected] --save
npm install --save --save-exact --include=dev
continue-on-error: false
- name: Build Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }}
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "############ pack #############"
npm run electron-pack
echo "############ dist #############"
npm run dist --publish=never
continue-on-error: false
- name: Build-Setup OSX
if: ${{ startsWith(matrix.os, 'macos') }}
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -rf ./build/
rm -rf ./dist/
brew install libusb
npm install -g npm@6
npm config set python /usr/bin/python2.7
npm install -g n
sudo n 12
npm install [email protected] --save
continue-on-error: false
- name: Build OSX
if: ${{ startsWith(matrix.os, 'macos') }}
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install --save --save-exact --include=dev
echo "############ pack #############"
npm run electron-pack
echo "############ dist #############"
npm run dist --publish=never
continue-on-error: false
- name: Build-Setup Windows
if: ${{ startsWith(matrix.os, 'windows') }}
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -Confirm:$false -Recurse ./build -ErrorAction:SilentlyContinue
rm -Confirm:$false -Recurse ./dist -ErrorAction:SilentlyContinue
#npm install yarn
#npm install -g --production windows-build-tools
npm install -g npm@6
npm config set python %USERPROFILE%\.windows-build-tools\python27\python.exe
npm install [email protected] --save
npm install --save --save-exact --include=dev
continue-on-error: false
- name: Build Windows
if: ${{ startsWith(matrix.os, 'windows') }}
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "############ pack #############"
npm run electron-pack
echo "############ dist #############"
npm run dist --publish=never
continue-on-error: false
- name: Upload Artifacts
if: always()
uses: actions/upload-artifact@master
with:
name: Nemesis-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}
path: |
dist/Nemesis*.AppImage
dist/Nemesis*.dmg
dist/Nemesis*.exe
draft:
if: startsWith(github.ref, 'refs/tags/')
needs: build
timeout-minutes: 10
continue-on-error: false
runs-on: ubuntu-latest
steps:
# for debugging
- name: show variables
run: |
echo "Build: ${{ github.RUN_NUMBER }}"
echo "Commit: ${{ github.SHA }}"
echo "Ref: ${{ github.REF}}"
echo "Actor: ${{ github.ACTOR }}"
echo "Repo: ${{ github.REPOSITORY }}"
continue-on-error: true
- name: download artifacts
uses: actions/download-artifact@master
with:
name: Nemesis-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}
continue-on-error: false
- name: list artifacts
run: |
ls -lh ./*.???
continue-on-error: true
- name: draft release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@master
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./Nemesis*.*
draft: true
prerelease: true
tag_name: ${{ github.RUN_NUMBER }} # use the build Number, but we manually change to version so that it creates a version-tag on release
name: DRAFT / Nemesis / GitHub Build ${{ github.RUN_NUMBER }}
body: |
### Build: ${{ github.RUN_NUMBER }}
### Commit: ${{ github.SHA }}
### Ref: ${{ github.REF}}
### Actor: ${{ github.ACTOR }}
### Repo: ${{ github.REPOSITORY }}
continue-on-error: true