forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 2.11 KB
/
Copy pathmobile_internal_build.yml
File metadata and controls
63 lines (56 loc) · 2.11 KB
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
name: Mobile internal builds
# App changes land on main in bursts, so a Codemagic build per merge is mostly superseded minutes
# later. Codemagic's own triggering has no rate limit, so the push trigger is replaced by this:
# a three-hourly batch that builds only when app code changed, plus an immediate build for an
# allowlisted author who needs their own change on a device now. Anyone else can still start a
# build by hand, here or in Codemagic.
on:
push:
branches: [main]
paths: ['app/**']
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
concurrency:
group: mobile-internal-build
cancel-in-progress: false
permissions:
contents: read
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
# The schedule run compares main against the last commit Codemagic built.
fetch-depth: 0
- name: Collect commit authors
id: authors
env:
EVENT_NAME: ${{ github.event_name }}
run: |
if [ "$EVENT_NAME" != "push" ]; then
echo "authors=" >> "$GITHUB_OUTPUT"
exit 0
fi
authors="$(jq -r '[.commits[]?.author.username // empty] | unique | join(",")' "$GITHUB_EVENT_PATH")"
echo "authors=${authors}" >> "$GITHUB_OUTPUT"
- name: Decide and dispatch
env:
CODEMAGIC_API_TOKEN: ${{ secrets.CODEMAGIC_API_TOKEN }}
CODEMAGIC_APP_ID: ${{ vars.CODEMAGIC_APP_ID || '66c95e6ec76853c447b8bcbb' }}
MOBILE_INSTANT_BUILD_ACTORS: ${{ vars.MOBILE_INSTANT_BUILD_ACTORS || 'mdmohsin7' }}
run: |
python3 .github/scripts/dispatch_mobile_internal_builds.py \
--event "${{ github.event_name }}" \
--actor "${{ github.actor }}" \
--commit-authors "${{ steps.authors.outputs.authors }}" \
--app-id "$CODEMAGIC_APP_ID" \
--branch main | tee "$RUNNER_TEMP/dispatch.txt"
{
echo "### Mobile internal builds"
echo
echo '```'
cat "$RUNNER_TEMP/dispatch.txt"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"