-
-
Notifications
You must be signed in to change notification settings - Fork 25
257 lines (235 loc) · 8.7 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
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
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]
workflow_dispatch:
name: Build EmuConfigurator
jobs:
build:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
timeout-minutes: 40
continue-on-error: false
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
#https://github.com/actions/runner-images
os: [ubuntu-22.04, macos-11, windows-2022]
outputs:
buildtag: ${{ steps.ids.outputs.buildtag }}
shortsha: ${{ steps.ids.outputs.shortsha }}
steps:
- name: git checkout
uses: actions/checkout@v4
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
- id: ids
name : set outputs
run: |
echo "::set-output name=buildtag::${{ env.REVISION_TAG }}"
echo "::set-output name=shortsha::${{ env.SHORT_SHA }}"
continue-on-error: true
- name: setup node
uses: actions/setup-node@v4
with:
node-version: '12'
continue-on-error: false
# for debugging
- name: show variables
run: |
echo "Build: ${{ github.RUN_NUMBER }}"
echo "Commit: ${{ github.SHA }}"
echo "ShortSHA: ${{ env.SHORT_SHA }}"
echo "Ref: ${{ GITHUB.REF }}"
echo "Rev Tag: ${{ env.REVISION_TAG }}"
echo "Actor: ${{ github.ACTOR }}"
echo "Repo: ${{ github.REPOSITORY }}"
echo "BuildTag: ${{ steps.ids.outputs.buildtag }}"
echo "ShortSha: ${{ steps.ids.outputs.shortsha }}"
continue-on-error: true
- name: which python
run: |
echo "python version:"
python --version
which python
# build stuff
- name: yarn install
run: |
npm config set fetch-retry-maxtimeout 600000 -g
yarn install --immutable --immutable-cache --check-cache
# this forces appdmg install even though package.json optionalDependencies has/needs it.
- name: setup macos
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
npm install [email protected] --python=python2.7
continue-on-error: true
- name: yarn gulp clean-release
run: yarn gulp clean-release
continue-on-error: true
- name: yarn gulp release --linux64
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt install -y rpm
yarn gulp release --linux64
continue-on-error: false
- name: yarn gulp release --osx64
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
yarn gulp release --osx64
continue-on-error: false
- name: yarn gulp release --win32 --win64
if: ${{ startsWith(matrix.os, 'windows') }}
run: yarn gulp release --win32 --win64
continue-on-error: false
- name: Upload Artifacts
if: ${{ startsWith(matrix.os, 'ubuntu') }}
uses: actions/upload-artifact@v4
with:
name: EmuConfigurator-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}-Linux
path: |
release/*.rpm
release/*.deb
release/*.zip
- name: Upload Artifacts
if: ${{ startsWith(matrix.os, 'macos') }}
uses: actions/upload-artifact@v4
with:
name: EmuConfigurator-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}-OSX
path: release/*.dmg
- name: Upload Artifacts
if: ${{ startsWith(matrix.os, 'windows') }}
uses: actions/upload-artifact@v4
with:
name: EmuConfigurator-${{ github.ACTOR }}-${{ github.RUN_NUMBER }}-Windows
path: |
release/*win*.exe
release/*win*.zip
releases:
if: startsWith(github.ref, 'refs/tags/')
needs: build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 10
runs-on: ubuntu-latest
continue-on-error: false
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 }}"
echo "outputs.buildtag: ${{ needs.build.outputs.buildtag }}"
echo "outputs.shortsha: ${{ needs.build.outputs.shortsha }}"
echo "NOW=$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_ENV
continue-on-error: true
- name: download artifacts
uses: actions/download-artifact@v4
with:
path: ./Artifacts
continue-on-error: false
- name: list artifacts
run: |
echo "######## debug find emuflight* ########"
find ./ -iname "emuflight-configurator*.*"
continue-on-error: true
# Draft Dev-Unstable releases via ncipollo/release-action
# softprops/action-gh-release fails to release on separate repo
- name: dev-unstable draft
if: contains(github.ref, 'test') || contains(github.ref, 'unstab')
uses: ncipollo/release-action@v1
with:
repo: dev-unstable
owner: emuflight
token: ${{ secrets.NC_PAT_EMUF }}
tag: "${{ env.NOW }}-cfg"
draft: true
prerelease: true
allowUpdates: true
artifacts: ./Artifacts/EmuConfigurator-*/emuflight-configurator*.*
artifactContentType: raw
name: "DEV-UNSTABLE EmuConfig / Build ${{ github.run_number }}"
body: |
## EmuConfigurator BUILD for TESTING
### Build ${{ github.run_number }}
### Commit SHA: ${{ needs.build.outputs.shortsha }} (${{ github.sha }})
### BuildTag: ${{ needs.build.outputs.buildtag }}
### What to Test/Feedback: (Feedback in EmuFlight's Discord or GitHub Discussions)
<details><summary>Changes in this Build:</summary>
<!-- require single blank line below -->
```
[insert commit history here]
```
</details>
continue-on-error: true
# Draft Dev-master releases via ncipollo/release-action
# softprops/action-gh-release fails to release on separate repo
- name: dev-master draft
if: contains(github.ref, 'master')
uses: ncipollo/release-action@v1
with:
repo: dev-master
owner: emuflight
token: ${{ secrets.NC_PAT_EMUF }}
tag: "${{ env.NOW }}-cfg"
draft: true
prerelease: true
allowUpdates: true
artifacts: ./Artifacts/EmuConfigurator-*/emuflight-configurator*.*
artifactContentType: raw
name: "DEV-MASTER EmuConfig / Build ${{ github.run_number }}"
body: |
## EmuConfigurator BUILD of MASTER
### Build ${{ github.run_number }}
### Commit SHA: ${{ needs.build.outputs.shortsha }} (${{ github.sha }})
### BuildTag: ${{ needs.build.outputs.buildtag }}
### Feedback Welcome in EmuFlight's Discord or GitHub Discussions.
<details><summary>Changes in this Build:</summary>
<!-- require single blank line below -->
```
[insert commit history here]
```
</details>
continue-on-error: true
- name: main-repo draft release
if: contains(github.ref, 'releas')
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: true
allowUpdates: true
# tag: use the build Number, but we MUST manually change to version so that it creates a version-tag on release
tag: "${{ github.RUN_NUMBER }}"
artifacts: ./Artifacts/EmuConfigurator-*/emuflight-configurator*.*
artifactContentType: raw
name: "DRAFT / EmuConfigurator / GitHub Build ${{ github.RUN_NUMBER }}"
body: |
## EmuConfigurator
### Build: ${{ github.RUN_NUMBER }}
### Commit SHA: ${{ needs.build.outputs.shortsha }} (${{ github.sha }})
### BuildTag: ${{ needs.build.outputs.buildtag }}
<details><summary>Changes in this Release:</summary>
<!-- require single blank line below -->
```
[insert commit history here]
```
</details>
continue-on-error: false