-
Notifications
You must be signed in to change notification settings - Fork 468
163 lines (150 loc) · 6.39 KB
/
build-release.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
name: Build and Release
on:
push:
tags:
- "*"
jobs:
release:
name: Build for ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64_cortex-a53
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710
sdk_name: -sdk-bcm27xx-bcm2710_
- arch: aarch64_cortex-a72
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa72
sdk_name: -sdk-mvebu-cortexa72_
- arch: aarch64_generic
sdk_url_path: http://downloads.openwrt.org/snapshots/targets/layerscape/armv8_64b
sdk_name: -sdk-layerscape-armv8_64b_
- arch: arm_arm1176jzf-s_vfp
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2708
sdk_name: -sdk-bcm27xx-bcm2708_
- arch: arm_cortex-a15_neon-vfpv4
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/ipq806x/generic
sdk_name: -sdk-ipq806x-generic_
- arch: arm_cortex-a5-vfpv4
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/at91/sama5
sdk_name: -sdk-at91-sama5_
- arch: arm_cortex-a7_neon-vfpv4
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2709
sdk_name: -sdk-bcm27xx-bcm2709_
- arch: arm_cortex-a8_vfpv3
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/sunxi/cortexa8
sdk_name: -sdk-sunxi-cortexa8_
- arch: arm_cortex-a9
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm53xx/generic
sdk_name: -sdk-bcm53xx-generic_
- arch: arm_cortex-a9_neon
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/imx/cortexa9
sdk_name: -sdk-imx-cortexa9_
- arch: arm_cortex-a9_vfpv3-d16
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9
sdk_name: -sdk-mvebu-cortexa9_
- arch: arm_fa526
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/gemini/generic
sdk_name: -sdk-gemini_
- arch: arm_mpcore
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/oxnas/ox820
sdk_name: -sdk-oxnas-ox820_
- arch: arm_xscale
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/kirkwood/generic
sdk_name: -sdk-kirkwood_
- arch: i386_pentium
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/x86/legacy
sdk_name: -sdk-x86-legacy_
- arch: i386_pentium4
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/x86/generic
sdk_name: -sdk-x86-generic_
- arch: mips64_octeonplus
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/octeon/generic
sdk_name: -sdk-octeon_
- arch: mipsel_24kc
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/ramips/mt7620
sdk_name: -sdk-ramips-mt7620_
- arch: mipsel_24kc_24kf
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/pistachio/generic
sdk_name: -sdk-pistachio_
- arch: mipsel_74kc
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm47xx/mips74k
sdk_name: -sdk-bcm47xx-mips74k_
- arch: mipsel_mips32
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm47xx/generic
sdk_name: -sdk-bcm47xx-generic_
- arch: mips_24kc
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/ath79/generic
sdk_name: -sdk-ath79-generic_
- arch: mips_mips32
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/bcm63xx/generic
sdk_name: -sdk-bcm63xx-generic_
- arch: x86_64
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/x86/64
sdk_name: -sdk-x86-64_
env:
SDK_URL_PATH: ${{ matrix.sdk_url_path }}
SDK_NAME: ${{ matrix.sdk_name }}
ARCH: ${{ matrix.arch }}
CACHE_DIR: ~/cache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Cache
uses: actions/cache@v4
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@v4
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
- name: Build package
env:
OPENWRT_GOLANG_COMMIT: ${{ secrets.OPENWRT_GOLANG_COMMIT }}
run: sh compile.sh
- name: Show CCache Status
run: |
eval "${{ env.SDK_HOME }}/staging_dir/host/bin/ccache -s"
- name: Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
files: "*.ipk"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify:
name: Notify Release Publish
runs-on: ubuntu-latest
env:
TRIGGER_URL: ${{ secrets.TRIGGER_URL }}
TRIGGER_TOKEN: ${{ secrets.TRIGGER_TOKEN }}
needs: release
steps:
- name: Notify Jenkins
run: |
if [ -z "$TRIGGER_URL" ] ; then
echo "::warning::No trigger url found, skip..."
exit 0
fi
curl -X POST \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Bearer $TRIGGER_TOKEN" \
-d "{\"event\":\"release\",\"repository\":\"${{ github.repository }}\",\"ref\":\"${{ github.ref }}\"}" \
"$TRIGGER_URL" || true