2020-03-29 00:48:23 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
ACTIONS_HEAD = """
|
|
|
|
# Update this file after adding/removing/renaming a target by running
|
|
|
|
# `make list-targets BROKEN=1 | ./contrib/actions/generate-actions.py > ./.github/workflows/build-gluon.yml`
|
|
|
|
|
|
|
|
name: Build Gluon
|
|
|
|
on:
|
|
|
|
push:
|
2020-04-09 18:33:25 +00:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- next
|
|
|
|
- v20*
|
2021-01-02 16:23:33 +00:00
|
|
|
paths:
|
|
|
|
- "modules"
|
|
|
|
- "Makefile"
|
|
|
|
- "scripts/**"
|
|
|
|
- "package/**"
|
|
|
|
- "patches/**"
|
|
|
|
- "targets/**"
|
|
|
|
- ".github/workflows/build-gluon.yml"
|
2020-03-29 00:48:23 +00:00
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
2021-01-02 16:23:33 +00:00
|
|
|
paths:
|
|
|
|
- "modules"
|
|
|
|
- "Makefile"
|
|
|
|
- "scripts/**"
|
|
|
|
- "package/**"
|
|
|
|
- "patches/**"
|
|
|
|
- "targets/**"
|
|
|
|
- ".github/workflows/build-gluon.yml"
|
2020-03-29 00:48:23 +00:00
|
|
|
jobs:
|
2021-01-01 22:21:52 +00:00
|
|
|
build_firmware:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target: [{matrix}]
|
2021-02-15 00:38:49 +00:00
|
|
|
runs-on: ubuntu-18.04
|
2020-03-29 00:48:23 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2020-04-05 13:20:58 +00:00
|
|
|
- name: Install Dependencies
|
2020-05-12 08:59:57 +00:00
|
|
|
run: sudo contrib/actions/install-dependencies.sh
|
2020-03-29 00:48:23 +00:00
|
|
|
- name: Build
|
2021-01-01 22:21:52 +00:00
|
|
|
run: contrib/actions/run-build.sh ${{{{ matrix.target }}}}
|
2020-05-12 08:44:18 +00:00
|
|
|
- name: Archive build logs
|
|
|
|
if: ${{{{ !cancelled() }}}}
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
2021-01-01 22:21:52 +00:00
|
|
|
name: ${{{{ matrix.target }}}}_logs
|
2020-05-12 08:44:18 +00:00
|
|
|
path: openwrt/logs
|
2020-03-29 00:48:23 +00:00
|
|
|
- name: Archive build output
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
2021-01-01 22:21:52 +00:00
|
|
|
name: ${{{{ matrix.target }}}}_output
|
2020-03-29 00:48:23 +00:00
|
|
|
path: output
|
|
|
|
"""
|
|
|
|
|
2021-01-01 22:21:52 +00:00
|
|
|
targets = []
|
2020-03-29 00:48:23 +00:00
|
|
|
|
|
|
|
for target in sys.stdin:
|
2021-01-01 22:21:52 +00:00
|
|
|
targets.append(target.strip())
|
|
|
|
|
|
|
|
output = ACTIONS_HEAD.format(matrix=", ".join(targets))
|
2020-03-29 00:48:23 +00:00
|
|
|
|
|
|
|
print(output)
|