forked from pymumu/smartdns
-
Notifications
You must be signed in to change notification settings - Fork 11
188 lines (180 loc) · 8.28 KB
/
test-openwrt-22.03.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Test Build Openwrt Stable
on:
push:
branches:
- master
workflow_dispatch:
jobs:
get-version:
name: get latest version number
runs-on: ubuntu-latest
outputs:
CUR_VERSION: ${{steps.get-version.outputs.CUR_VERSION}}
steps:
- uses: actions/checkout@v3
with:
ref: VERSION_CONTROL
fetch-depth: 1
path: version_control
- name: get version
id: get-version
run: |
#获取当前版本号
pre_version=$(cat version_control/VERSION | grep "PREFEX" | sed 's/PREFEX=\(.*\)/\1/')
cur_version=$(cat version_control/VERSION | grep "CUR_VERS" | sed 's/CUR_VERS=\(.*\)/\1/')
echo "CUR_VERSION=$pre_version$cur_version" >> $GITHUB_OUTPUT
release:
name: Build for ${{ matrix.arch }}
needs: get-version
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64_cortex-a53
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm27xx/bcm2710/
sdk_name: -sdk-22.03.3-bcm27xx-bcm2710_
- arch: aarch64_cortex-a72
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/mvebu/cortexa72
sdk_name: -sdk-22.03.3-mvebu-cortexa72_
- arch: aarch64_generic
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/layerscape/armv8_64b
sdk_name: -sdk-22.03.3-layerscape-armv8_64b_
- arch: arm_arm1176jzf-s_vfp
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm27xx/bcm2708
sdk_name: -sdk-22.03.3-bcm27xx-bcm2708_
- arch: arm_cortex-a15_neon-vfpv4
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/ipq806x/generic
sdk_name: -sdk-22.03.3-ipq806x-generic_
- arch: arm_cortex-a5-vfpv4
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/at91/sama5
sdk_name: -sdk-22.03.3-at91-sama5_
- arch: arm_cortex-a7_neon-vfpv4
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm27xx/bcm2709
sdk_name: -sdk-22.03.3-bcm27xx-bcm2709_
- arch: arm_cortex-a8_vfpv3
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/sunxi/cortexa8
sdk_name: -sdk-22.03.3-sunxi-cortexa8_
- arch: arm_cortex-a9
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm53xx/generic
sdk_name: -sdk-22.03.3-bcm53xx-generic_
- arch: arm_cortex-a9_vfpv3
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/mvebu/cortexa9
sdk_name: -sdk-22.03.3-mvebu-cortexa9_
- arch: arm_cortex-a9_vfpv3-d16
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/mvebu/cortexa9
sdk_name: -sdk-22.03.3-mvebu-cortexa9_
- arch: arm_fa526
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/gemini/generic
sdk_name: -sdk-22.03.3-gemini_
- arch: arm_mpcore
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/oxnas/ox820
sdk_name: -sdk-22.03.3-oxnas-ox820_
- arch: arm_xscale
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/kirkwood/generic
sdk_name: -sdk-22.03.3-kirkwood_
- arch: i386_pentium
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/x86/legacy
sdk_name: -sdk-22.03.3-x86-legacy_
- arch: i386_pentium4
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/x86/generic
sdk_name: -sdk-22.03.3-x86-generic_
- arch: mips64_octeon
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/octeon/generic
sdk_name: -sdk-22.03.3-octeon-generic_
- arch: mipsel_24kc
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/ramips/mt7620
sdk_name: -sdk-22.03.3-ramips-mt7620_
- arch: mipsel_24kc_24kf
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/pistachio/generic
sdk_name: -sdk-22.03.3-pistachio_
- arch: mipsel_74kc
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm47xx/mips74k
sdk_name: -sdk-22.03.3-bcm47xx-mips74k_
- arch: mipsel_mips32
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm47xx/generic
sdk_name: -sdk-22.03.3-bcm47xx-generic_
- arch: mips_24kc
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/ath79/generic
sdk_name: -sdk-22.03.3-ath79-generic_
- arch: mips_mips32
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/bcm63xx/generic
sdk_name: -sdk-22.03.3-bcm63xx-generic_
- arch: x86_64
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/x86/64
sdk_name: -sdk-22.03.3-x86-64_
- arch: powerpc_464fp
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/apm821xx/nand
sdk_name: -sdk-22.03.3-apm821xx-nand_
- arch: powerpc_8540
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/mpc85xx/p1010
sdk_name: -sdk-22.03.3-mpc85xx-p1010_
- arch: arc_archs
sdk_url_path: https://downloads.openwrt.org/releases/22.03.3/targets/archs38/generic
sdk_name: -sdk-22.03.3-archs38-generic_
env:
SDK_URL_PATH: ${{ matrix.sdk_url_path }}
SDK_NAME: ${{ matrix.sdk_name }}
ARCH: ${{ matrix.arch }}
CACHE_DIR: ~/cache
OPENWRT_RELEASE: 22.03.3
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_DIR }}
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:release:cache:${{ github.run_number }}
restore-keys: |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:cache:
- name: Setup CCache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:release:ccache:${{ github.run_number }}
restore-keys: |
${{ runner.os }}:openwrt-v2ray:${{ env.ARCH }}:ccache:
- name: Install Dependencies
run: |
sudo apt-get update && \
sudo apt-get install -yq gettext libncurses5-dev rsync xsltproc
- name: Prepare For Build
run: |
sdk_home="$(mktemp -d)"
test -d ~/.ccache || mkdir -p ~/.ccache
ln -sf ~/.ccache "$sdk_home/.ccache"
echo "SDK_HOME=$sdk_home" >> $GITHUB_ENV
echo "CONFIG_CCACHE=y" >> $GITHUB_ENV
#修改版本号
sed -i "s/VER=.*/VER=${{needs.get-version.outputs.CUR_VERSION}}/" ${{ github.workspace }}/package/openwrt/make_openwrt.sh
- name: Build package
env:
OPENWRT_GOLANG_COMMIT: ${{ secrets.OPENWRT_GOLANG_COMMIT }}
run: sh ${{ github.workspace }}/package/openwrt/make_openwrt.sh
- name: Show CCache Status
run: |
eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s"
# - name: Upload To Artifact
# uses: actions/upload-artifact@v2
# with:
# name: smartdns-${{ matrix.arch }}-static
# path: "package/openwrt/smartdns*.ipk"
- name: Generate release tag
id: tag
run: |
echo "release_tag=${{needs.get-version.outputs.CUR_VERSION}}-OpenWrt" >> $GITHUB_OUTPUT
touch release.txt
echo "同步更新上游代码" >> release.txt
echo ${{ github.sha }} >> Release.txt
echo "status=success" >> $GITHUB_OUTPUT
- name: Upload firmware to release
uses: softprops/action-gh-release@v1
if: steps.tag.outputs.status == 'success'
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
# do not use GITHUB_TOKEN
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
body_path: release.txt
files: ${{ github.workspace }}/package/openwrt/smartdns*.ipk