forked from JiaY-shi/build-gl.inet
-
Notifications
You must be signed in to change notification settings - Fork 153
71 lines (64 loc) · 2.19 KB
/
build-glinet.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
name: build gl.inet
on:
workflow_dispatch:
inputs:
device:
description: '选择设备'
required: true
default: 'target_wlan_ap-gl-ax1800'
type: choice
options:
- target_wlan_ap-gl-ax1800
- target_wlan_ap-gl-axt1800
- target_wlan_ap-gl-ax1800-5-4
- target_wlan_ap-gl-axt1800-5-4
- target_ipq40xx_gl-a1300
- target_mt7981_gl-mt2500
- target_mt7981_gl-mt3000
ui:
description: '是否包含官方UI'
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: update
run: |
sudo apt update
sudo apt upgrade -y
sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml subversion -y
git config --global user.email "aa@163.com"
git config --global user.name "aa"
- name: make
run: |
./build.sh ~ ${{ inputs.device }} ${{ inputs.ui }}
- name: Organize files
id: organize
if: true && !failure() && !cancelled()
run: |
cd ~/openwrt/bin/targets/*/*
rm -rf packages
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
echo "::set-output name=status::success"
- name: Upload firmware directory
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && !cancelled() && !failure()
with:
name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}
- name: Generate release tag
id: tag
if: true && !failure() && !cancelled()
run: |
echo "::set-output name=release_tag::$(date +"%Y.%m.%d-%H%M")"
echo "::set-output name=status::success"
- name: Upload firmware to release
uses: softprops/action-gh-release@v1
if: steps.tag.outputs.status == 'success' && !cancelled() && !failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: ${{ env.FIRMWARE }}/*