-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (120 loc) · 3.71 KB
/
release_bundle.yaml
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
name: "Build firmware release bundles"
on:
push:
branches:
- '*'
tags:
- '*'
workflow_dispatch:
env:
ci: 1
defaults:
run:
shell: bash
jobs:
build:
name: "Build"
runs-on: "ubuntu-latest"
timeout-minutes: 20
steps:
- uses: "actions/checkout@v2"
with:
fetch-depth: 0
- uses: "actions/cache@v3"
with:
path: "./stm32-tools"
key: ${{ runner.os }}-${{ hashFiles('**/cmake/*') }}-${{ secrets.CACHE_VERSION }}
- name: 'CMake configure'
run: |
cmake --preset=cross . -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: 'Build images'
run: |
cmake --build --preset=firmware-g4 --target firmware-images firmware-applications
- name: 'Prep images for upload'
run: |
cmake --install ./build-cross
- name: 'Upload application artifact'
uses: actions/upload-artifact@v3
with:
name: 'firmware-applications-${{github.ref_name}}'
path: |
dist/applications/*
- name: 'Make images contain the refname'
run: |
for distpath in ./dist/*images ; do
pushd $distpath
for imagefile in ./*.hex ; do
base=$(basename $imagefile .hex)
mv $imagefile $base-${{github.ref_name}}.hex
done
popd
done
- name: 'Upload all-images artifact'
uses: actions/upload-artifact@v3
with:
name: 'firmware-images-${{github.ref_name}}'
path: |
dist/images/*.hex
- name: 'Upload robot-images artifact'
uses: actions/upload-artifact@v3
with:
name: 'firmware-robot-images-${{github.ref_name}}'
path: |
dist/robot-images/*.hex
- name: 'Upload pipette-images artifact'
uses: actions/upload-artifact@v3
with:
name: 'firmware-pipette-images-${{github.ref_name}}'
path: |
dist/pipette-images/*.hex
- name: 'Upload gripper-images artifact'
uses: actions/upload-artifact@v3
with:
name: 'firmware-gripper-images-${{github.ref_name}}'
path: |
dist/gripper-images/*.hex
release:
name: 'Do a release'
runs-on: 'ubuntu-latest'
timeout-minutes: 10
needs: ['build']
if: github.ref_type == 'tag'
steps:
- name: 'Download artifacts'
uses: 'actions/download-artifact@v3'
with:
path: .
- name: 'Create zips for each sub-artifact'
run: |
for artifactname in firmware-*-*${{github.ref_name}} ; do
pushd ./$artifactname
zip ../${artifactname}.zip ./*
popd
done
- name: 'Create a release'
uses: 'ncipollo/[email protected]'
with:
draft: true
generateReleaseNotes: true
replacesArtifacts: true
allowUpdates: true
- name: 'Add firmware category zips'
uses: 'ncipollo/[email protected]'
with:
artifacts: ./firmware-*-${{github.ref_name}}.zip
artifactContentType: application/zip
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
- name: 'Add latest firmware images'
uses: 'ncipollo/[email protected]'
with:
artifacts: './firmware-*-images-${{github.ref_name}}/*.hex'
artifactContentType: text/plain
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true