1
- name : ' Build'
1
+ name : ' Build artifact '
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- dev
7
- - " release* "
7
+ - main
8
8
tags :
9
9
- ' *'
10
10
pull_request :
11
11
12
12
env :
13
13
TARGETS : f7
14
14
DEFAULT_TARGET : f7
15
- FBT_TOOLCHAIN_PATH : /home/runner/work
16
15
17
16
jobs :
18
- main :
17
+ build :
19
18
runs-on : ubuntu-latest
20
19
steps :
21
- - name : ' Decontaminate previous build leftovers'
22
- run : |
23
- if [ -d .git ]; then
24
- git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
25
- fi
26
20
27
21
- name : ' Checkout code'
28
22
uses : actions/checkout@v3
29
23
with :
30
24
fetch-depth : 0
31
25
ref : ${{ github.event.pull_request.head.sha }}
32
26
33
- - name : ' Get commit details'
34
- id : names
35
- run : |
36
- if [[ ${{ github.event_name }} == 'pull_request' ]]; then
37
- TYPE="pull"
38
- elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
39
- TYPE="tag"
40
- else
41
- TYPE="other"
42
- fi
43
- python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
44
- echo random_hash=$(openssl rand -base64 40 | shasum -a 256 | awk '{print $1}') >> $GITHUB_OUTPUT
45
- echo "event_type=$TYPE" >> $GITHUB_OUTPUT
46
-
47
- - name : ' Make artifacts directory'
48
- run : |
49
- rm -rf artifacts
50
- rm -rf map_analyser_files
51
- mkdir artifacts
52
- mkdir map_analyser_files
53
-
54
- - name : ' Bundle scripts'
55
- run : |
56
- tar czpf artifacts/flipper-z-any-scripts-${SUFFIX}.tgz scripts debug
57
-
58
27
- name : ' Build the firmware'
59
28
run : |
60
29
set -e
61
30
for TARGET in ${TARGETS}; do
62
31
TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
63
- ./fbt TARGET_HW=$TARGET copro_dist updater_package \
64
- ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
65
- done
66
-
67
- - name : ' Move upload files'
68
- run : |
69
- set -e
70
- for TARGET in ${TARGETS}; do
71
- mv dist/${TARGET}-*/* artifacts/
32
+ ./fbt TARGET_HW=$TARGET updater_package
72
33
done
73
34
74
35
- name : " Check for uncommitted changes"
75
36
run : |
76
37
git diff --exit-code
77
38
78
- - name : ' Bundle resources'
79
- run : |
80
- tar czpf "artifacts/flipper-z-any-resources-${SUFFIX}.tgz" -C assets resources
81
-
82
- - name : ' Bundle core2 firmware'
83
- run : |
84
- cp build/core2_firmware.tgz "artifacts/flipper-z-any-core2_firmware-${SUFFIX}.tgz"
85
-
86
- - name : ' Copy map analyser files'
87
- run : |
88
- cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
89
- cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf
90
- cp ${{ github.event_path }} map_analyser_files/event.json
91
-
92
39
- name : ' Updater artifact'
93
40
uses : actions/upload-artifact@v3
94
41
with :
95
42
name : updater
96
43
path : |
97
- artifacts/f7-*
98
-
99
- - name : ' Firmware artifact'
100
- uses : actions/upload-artifact@v3
101
- with :
102
- name : firmware
103
- path : |
104
- artifacts
44
+ dist/${{ env.DEFAULT_TARGET }}-*
105
45
106
46
# - name: 'Find Previous Comment'
107
47
# if: ${{ github.event.pull_request }}
110
50
# with:
111
51
# issue-number: ${{ github.event.pull_request.number }}
112
52
# comment-author: 'github-actions[bot]'
113
- # body-includes: 'Compiled firmware for commit '
53
+ # body-includes: 'Compiled firmware: '
114
54
115
55
# - name: Artifact info
116
56
# id: artifact-info
@@ -125,44 +65,6 @@ jobs:
125
65
# comment-id: ${{ steps.fc.outputs.comment-id }}
126
66
# issue-number: ${{ github.event.pull_request.number }}
127
67
# body: |
128
- # **Compiled firmware for commit `${{steps.names.outputs.commit_sha}}` :**
68
+ # **Compiled firmware:**
129
69
# - [📦 Update package](${{steps.artifact-info.outputs.artifacts[0].archive_download_url}})
130
70
# edit-mode: replace
131
-
132
- compact :
133
- if : ${{ !startsWith(github.ref, 'refs/tags') }}
134
- runs-on : ubuntu-latest
135
- steps :
136
- - name : ' Decontaminate previous build leftovers'
137
- run : |
138
- if [ -d .git ]
139
- then
140
- git submodule status \
141
- || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
142
- fi
143
-
144
- - name : ' Checkout code'
145
- uses : actions/checkout@v3
146
- with :
147
- fetch-depth : 0
148
- submodules : true
149
- ref : ${{ github.event.pull_request.head.sha }}
150
-
151
- - name : ' Get commit details'
152
- run : |
153
- if [[ ${{ github.event_name }} == 'pull_request' ]]; then
154
- TYPE="pull"
155
- elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
156
- TYPE="tag"
157
- else
158
- TYPE="other"
159
- fi
160
- python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
161
-
162
- - name : ' Build the firmware'
163
- run : |
164
- set -e
165
- for TARGET in ${TARGETS}; do
166
- TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
167
- ./fbt TARGET_HW=$TARGET DEBUG=0 COMPACT=1 fap_dist updater_package
168
- done
0 commit comments