@@ -27,11 +27,29 @@ jobs:
27
27
- {os: ubuntu-latest, board_version: v3.6-56V, debug: false}
28
28
29
29
runs-on : ${{ matrix.os }}
30
+ outputs :
31
+ channel : ${{ steps.release-info.outputs.channel }}
32
+ version : ${{ steps.release-info.outputs.version }}
30
33
steps :
31
34
- uses : actions/checkout@v2
32
35
with :
33
36
fetch-depth : 0 # fetch entire history to get version information
34
37
38
+ - name : Get release name and channel
39
+ id : release-info
40
+ shell : python
41
+ run : |
42
+ if "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/fw-v0.5.') }}" == "true":
43
+ channel = "master"
44
+ version = "${{ github.ref }}"[len("refs/tags/fw-v"):]
45
+
46
+ else:
47
+ channel = "none"
48
+ version = "${{ github.sha }}"
49
+
50
+ print("::set-output name=channel::" + channel)
51
+ print("::set-output name=version::" + version)
52
+
35
53
- name : Install prerequisites (Debian)
36
54
if : startsWith(matrix.os, 'ubuntu-')
37
55
run : |
@@ -114,7 +132,7 @@ jobs:
114
132
mv tup_build.sh tup_build.bat # in reality this is a .bat script on windows
115
133
.\tup_build.bat
116
134
117
- - name : Upload binary
135
+ - name : Upload binary as artifact
118
136
if : ${{ matrix.os == 'ubuntu-latest' && matrix.debug == false }}
119
137
uses : actions/upload-artifact@v2
120
138
with :
@@ -124,6 +142,46 @@ jobs:
124
142
Firmware/build/ODriveFirmware.bin
125
143
Firmware/build/ODriveFirmware.hex
126
144
145
+ - name : Copy firmware to temp folder
146
+ run : |
147
+ mkdir ${{ github.workspace }}/out
148
+ cp ${{ github.workspace }}/Firmware/build/ODriveFirmware.elf ${{ github.workspace }}/out/firmware.elf
149
+
150
+ - name : Upload firmware to ODrive release system
151
+ if : ${{ steps.release-info.outputs.channel == 'master' && matrix.os == 'ubuntu-latest' && matrix.debug == false && (startsWith(matrix.board_version, 'v3.5-') || startsWith(matrix.board_version, 'v3.6-')) }}
152
+ uses : ./.github/actions/upload-release
153
+ with :
154
+ release_type : firmware
155
+ version : ${{ steps.release-info.outputs.version }}
156
+ src_dir : out
157
+ do_access_key : ${{ secrets.DIGITALOCEAN_ACCESS_KEY }}
158
+ do_secret_key : ${{ secrets.DIGITALOCEAN_SECRET_KEY }}
159
+ odrive_api_key : ${{ secrets.ODRIVE_API_KEY }}
160
+ product : ODrive ${{ matrix.board_version }}
161
+ app : default
162
+ variant : public
163
+
164
+ make-release :
165
+ needs : [compile] # require all builds to succeed before we actually make the release
166
+ if : needs.compile.outputs.channel == 'master'
167
+ strategy :
168
+ fail-fast : false
169
+ runs-on : ubuntu-latest
170
+ steps :
171
+ - name : Checkout git repository
172
+ uses : actions/checkout@v2
173
+
174
+ - name : Install Python dependencies
175
+ run : pip install aiohttp appdirs
176
+
177
+ - name : Add version to release channel
178
+ uses : ./.github/actions/add-version-to-channel
179
+ with :
180
+ release_type : firmware
181
+ channel : ${{ needs.compile.outputs.channel }}
182
+ version : ${{ needs.compile.outputs.version }}
183
+ odrive_api_key : ${{ secrets.ODRIVE_API_KEY }}
184
+
127
185
code-checks :
128
186
strategy :
129
187
fail-fast : false
0 commit comments