-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (58 loc) · 1.95 KB
/
build-all.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
name: Build all target
on:
schedule:
- cron: '0 2 * * 5'
workflow_dispatch:
inputs:
openwrt_tag:
type: string
jobs:
setup:
name: Setup
runs-on: self-hosted
outputs:
targets: ${{ steps.find_targets.outputs.targets }}
targets_subtargets: ${{ steps.find_targets.outputs.targets_subtargets }}
openwrt_tag: ${{ steps.set_env.outputs.openwrt_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set env
id: set_env
run: |
openwrt_tag=${{ inputs.openwrt_tag }}
[ -n "${openwrt_tag}" ] || openwrt_tag=$(curl -sL https://github.com/openwrt/openwrt | sed -n 's/.*\/openwrt\/openwrt\/releases\/tag\/\(.*\)">/\1/p')
echo "openwrt_tag=${openwrt_tag}" >> "$GITHUB_OUTPUT"
- name: Set targets
id: find_targets
run: python3 -B ./.github/workflows/scripts/get_targets.py | while read v;do echo "$v" >> "$GITHUB_OUTPUT"; done
build:
name: Build target
needs: setup
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup.outputs.targets_subtargets)}}
uses: ./.github/workflows/build.yml
with:
target: ${{ matrix.target }}
subtarget: ${{ matrix.subtarget }}
output_image_type: ${{ matrix.output_image_type }}
openwrt_tag: ${{ needs.setup.outputs.openwrt_tag }}
release:
name: Release
runs-on: self-hosted
needs: [setup,build]
steps:
- name: Set tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
openwrt_tag=${{ needs.setup.outputs.openwrt_tag }}
git tag ${openwrt_tag} --force
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${openwrt_tag} --force
- name: Release file
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.setup.outputs.openwrt_tag }}
files: /data/openwrt/artifact/openwrt-*