forked from MeIsReallyBa/padavan-4.4
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (87 loc) · 2.96 KB
/
Build-padavan-4.4.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
103
104
105
name: Build-padavan-4.4
# Controls when the action will run.
on:
push:
pull_request:
workflow_dispatch:
release:
types: [published]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
permissions: write-all
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
cleanup:
runs-on: ubuntu-20.04
steps:
- name: Delete Old Releases
uses: dev-drprasad/delete-older-releases@master
with:
keep_latest: 0
delete_tags: true
- name: Delete Old Workflows
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 0
keep_minimum_runs: 0
build:
name: build
needs: cleanup
runs-on: ubuntu-20.04
if: ${{ !(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) }}
env:
build_variant: ${{ matrix.build_variant }}
targets: ${{ matrix.targets }}
images_dir: /opt/images
strategy:
matrix:
include:
- build_variant: "re-sp-01b"
targets: "JDCLOUD-RE-SP-01B"
- build_variant: "k2p"
targets: "K2P"
- build_variant: "mi-r3g"
targets: "MI-R3G"
steps:
- name: Checkout Projects
uses: actions/checkout@main
- name: Prepare environment
run: |
sudo apt update
sudo apt install libtool-bin gperf python3-docutils autopoint gettext
- name: Initialization Values
run: |
export build_date=$(TZ=UTC-8 date +"%y.%m.%d")
export release_version="padavan-4.4"
echo "build_date=$build_date" >> $GITHUB_ENV
echo "release_version=$release_version" >> $GITHUB_ENV
- name: Run shellcheck
run: sh ./trunk/tools/shellcheck.sh
- name: Prepare toolchain
run: |
cd toolchain-mipsel
sh dl_toolchain.sh
# sh dl_toolchain_vendor.sh
- name: Start build
run: |
cd trunk
mkdir -p ${images_dir}
for m in $targets; do fakeroot ./build_firmware_ci $m; \
if [ $? = 0 ]; then cp -f images/*.trx ${images_dir}/$m.trx; else exit 1; fi; \
./clear_tree_simple >/dev/null 2>&1; done
- name: Create archive
if: ${{ github.event_name != 'release' && success() }}
run: |
ls -lh ${images_dir}
GIT_VERSION=`git rev-parse --short=7 HEAD 2>/dev/null` && [ -n "$GIT_VERSION" ] && \
image_name=images_${build_variant}_${GIT_VERSION} || image_name=images_${build_variant}
cd ${images_dir}; md5sum *.trx |tee md5sum.txt; 7z a -mx=9 ${image_name}.7z ./*
echo "image_name=${image_name}" >> $GITHUB_ENV
- name: Upload images to Releases
uses: softprops/action-gh-release@master
with:
tag_name: ${{env.release_version}}_${{env.build_date}}
files: ${{ env.images_dir }}/*.trx
body: |
padavan-4.4固件
請選擇合理的固件包