forked from koksaver/OpenWrt360_6.1
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 2.65 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
name: Build
on:
push:
workflow_dispatch:
inputs:
upload_release:
description: 'Whether to upload binaries to releases'
required: true
default: '0'
backup_dl_src:
description: 'Whether to backup downloaded sources to releases'
required: false
default: '0'
jobs:
build:
runs-on: ubuntu-22.04
container:
image: pexcn/docker-images:bookworm-openwrt
volumes:
- /usr/local:/usr/local
- /usr/lib/google-cloud-sdk:/usr/lib/google-cloud-sdk
- /usr/share/dotnet:/usr/share/dotnet
- /usr/share/swift:/usr/share/swift
- /opt/az:/opt/az
- /opt/google:/opt/google
- /opt/microsoft:/opt/microsoft
- /opt/pipx:/opt/pipx
- /opt/hostedtoolcache:/opt/hostedtoolcache
env:
TZ: Asia/Taipei
BUILD_REPO: https://github.com/openwrt-ipq60xx/openwrt.git
BUILD_PROFILE: ${{ matrix.PROFILE }}
BACKUP_DL_SRC: ${{ github.event.inputs.backup_dl_src }}
strategy:
fail-fast: false
matrix:
PROFILE:
- qualcommax-ipq60xx
- qualcommax-ipq60xx_emmc
steps:
- name: Maximize disk space
uses: pexcn/maximize-disk-space@v1
with:
use-system-docker: false
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: true
- name: Make build cache
uses: actions/cache@v4
with:
path: |
~/.ccache
/builder/.ccache
key: ${{ runner.os }}-${{ github.ref_name }}-${{ env.BUILD_PROFILE }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ github.ref_name }}-${{ env.BUILD_PROFILE }}-
- name: Build firmware
run: ./build.sh
- name: Upload to Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_PROFILE }}
path: openwrt/bin
- name: Set release tag
run: echo "RELEASE_TAG=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Upload to Releases
if: (github.event_name == 'push' && startsWith(github.event.head_commit.message, '[release] ')) || (github.event.inputs.upload_release == 1)
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
files: ${{ env.BUILD_PROFILE }}.tar.gz
- name: Backup downloaded sources
if: (github.event_name == 'push' && startsWith(github.event.head_commit.message, '[release] ')) || (github.event.inputs.backup_dl_src == 1)
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
files: ${{ env.BUILD_PROFILE }}_dl-src.tar.gz