-
Notifications
You must be signed in to change notification settings - Fork 59
102 lines (94 loc) · 2.84 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
name: Build faps
on:
push:
branches:
- dev
pull_request:
workflow_dispatch:
inputs:
sdk-channel:
description: 'SDK channel to use'
required: true
default: 'rc'
type: choice
options:
- 'rc'
- 'release'
- 'dev'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: recursive
- name: Set up ufbt
uses: flipperdevices/[email protected]
with:
sdk-channel: ${{ github.event.inputs.sdk-channel || 'rc'}}
task: setup
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
dir_names: true
dir_names_max_depth: 1
dir_names_exclude_current_dir: true
files: |
!.*/**
- name: Build & lint updated apps
if: steps.changed-files.outputs.all_changed_and_modified_files != ''
run: |
BUILD_FAILED=0
for appdir in ${{ steps.changed-files.outputs.all_changed_and_modified_files }} ; do
if [ ! -f "$appdir/application.fam" ] ; then
echo "Skipping $appdir, no application.fam. File may have been deleted."
continue
fi
echo "Building in $appdir"
pushd "$appdir"
if ! ufbt build faps ; then
echo "::error::Failed to build $appdir"
BUILD_FAILED=1
fi
popd
done
if [ $BUILD_FAILED -ne 0 ] ; then
echo One or more apps failed to build
exit 1
fi
- name: Build & lint all apps
id: build-all
if: steps.changed-files.outputs.all_changed_and_modified_files == ''
run: |
BUILD_FAILED=0
for appdir in $( dirname $( find . -name application.fam ) ) ; do
if [ ! -f "$appdir/application.fam" ] ; then
echo "Skipping $appdir, no application.fam. File may have been deleted."
continue
fi
echo "Building in $appdir"
pushd "$appdir"
if ! ufbt build faps ; then
BUILD_FAILED=1
echo "::error::Failed to build $appdir"
fi
popd
done
if [ $BUILD_FAILED -ne 0 ] ; then
echo One or more apps failed to build
exit 1
fi
- name: Gather build artifacts
if: steps.build-all.conclusion == 'success'
run: |
mkdir -p dist
cp -v $( find . -name '*.fap' ) dist/
- name: Upload all .fap files
if: steps.build-all.conclusion == 'success'
uses: actions/upload-artifact@v4
with:
name: faps
path: dist/*.fap