@@ -72,17 +72,23 @@ jobs:
7272 arch : [ "386", amd64, arm64 ]
7373 legacy_go : [ false ]
7474 include :
75- - { os: linux, arch: amd64, debian: amd64, rpm: x86_64, pacman: x86_64 }
76- - { os: linux, arch: "386", debian: i386, rpm: i386 }
77- - { os: linux, arch: arm, goarm: "6", debian: armel, rpm: armv6hl }
78- - { os: linux, arch: arm, goarm: "7", debian: armhf, rpm: armv7hl, pacman: armv7hl }
79- - { os: linux, arch: arm64, debian: arm64, rpm: aarch64, pacman: aarch64 }
80- - { os: linux, arch: mips64le, debian: mips64el, rpm: mips64el }
81- - { os: linux, arch: mipsle, debian: mipsel, rpm: mipsel }
75+ - { os: linux, arch: amd64, debian: amd64, rpm: x86_64, pacman: x86_64, openwrt: "x86_64" }
76+ - { os: linux, arch: "386", go386: sse2, debian: i386, rpm: i386, openwrt: "i386_pentium4" }
77+ - { os: linux, arch: "386", go386: softfloat, openwrt: "i386_pentium-mmx" }
78+ - { os: linux, arch: arm, goarm: "5", openwrt: "arm_arm926ej-s arm_cortex-a7 arm_cortex-a9 arm_fa526 arm_xscale" }
79+ - { os: linux, arch: arm, goarm: "6", debian: armel, rpm: armv6hl, openwrt: "arm_arm1176jzf-s_vfp" }
80+ - { os: linux, arch: arm, goarm: "7", debian: armhf, rpm: armv7hl, pacman: armv7hl, openwrt: "arm_cortex-a5_vfpv4 arm_cortex-a7_neon-vfpv4 arm_cortex-a7_vfpv4 arm_cortex-a8_vfpv3 arm_cortex-a9_neon arm_cortex-a9_vfpv3-d16 arm_cortex-a15_neon-vfpv4" }
81+ - { os: linux, arch: arm64, debian: arm64, rpm: aarch64, pacman: aarch64, openwrt: "aarch64_cortex-a53 aarch64_cortex-a72 aarch64_cortex-a76 aarch64_generic" }
82+ - { os: linux, arch: mips, gomips: softfloat, openwrt: "mips_24kc mips_4kec mips_mips32" }
83+ - { os: linux, arch: mipsle, gomips: hardfloat, debian: mipsel, rpm: mipsel, openwrt: "mipsel_24kc_24kf" }
84+ - { os: linux, arch: mipsle, gomips: softfloat, openwrt: "mipsel_24kc mipsel_74kc mipsel_mips32" }
85+ - { os: linux, arch: mips64, gomips: softfloat, openwrt: "mips64_mips64r2 mips64_octeonplus" }
86+ - { os: linux, arch: mips64le, gomips: hardfloat, debian: mips64el, rpm: mips64el }
87+ - { os: linux, arch: mips64le, gomips: softfloat, openwrt: "mips64el_mips64r2" }
8288 - { os: linux, arch: s390x, debian: s390x, rpm: s390x }
8389 - { os: linux, arch: ppc64le, debian: ppc64el, rpm: ppc64le }
84- - { os: linux, arch: riscv64, debian: riscv64, rpm: riscv64 }
85- - { os: linux, arch: loong64, debian: loongarch64, rpm: loongarch64 }
90+ - { os: linux, arch: riscv64, debian: riscv64, rpm: riscv64, openwrt: "riscv64_generic" }
91+ - { os: linux, arch: loong64, debian: loongarch64, rpm: loongarch64, openwrt: "loongarch64_generic" }
8692
8793 - { os: windows, arch: "386", legacy_go: true }
8894 - { os: windows, arch: amd64, legacy_go: true }
@@ -147,7 +153,10 @@ jobs:
147153 CGO_ENABLED : " 0"
148154 GOOS : ${{ matrix.os }}
149155 GOARCH : ${{ matrix.arch }}
156+ GO386 : ${{ matrix.go386 }}
150157 GOARM : ${{ matrix.goarm }}
158+ GOMIPS : ${{ matrix.gomips }}
159+ GOMIPS64 : ${{ matrix.gomips }}
151160 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
152161 - name : Build Android
153162 if : matrix.os == 'android'
@@ -167,12 +176,24 @@ jobs:
167176 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168177 - name : Set name
169178 run : |-
170- ARM_VERSION=$([ -n '${{ matrix.goarm}}' ] && echo 'v${{ matrix.goarm}}' || true)
171- LEGACY=$([ '${{ matrix.legacy_go }}' = 'true' ] && echo "-legacy" || true)
172- DIR_NAME="sing-box-${{ needs.calculate_version.outputs.version }}-${{ matrix.os }}-${{ matrix.arch }}${ARM_VERSION}${LEGACY}"
173- PKG_NAME="sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.arch }}${ARM_VERSION}"
179+ DIR_NAME="sing-box-${{ needs.calculate_version.outputs.version }}-${{ matrix.os }}-${{ matrix.arch }}"
180+ PKG_NAME="sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.arch }}"
181+ OPENWRT_PKG_NAME="sing-box_${{ needs.calculate_version.outputs.version }}_openwrt"
182+ if [[ -n "${{ matrix.goarm }}" ]]; then
183+ DIR_NAME="${DIR_NAME}v${{ matrix.goarm }}"
184+ PKG_NAME="${PKG_NAME}v${{ matrix.goarm }}"
185+ elif [[ -n "${{ matrix.go386 }}" && "${{ matrix.go386 }}" != 'sse2' ]]; then
186+ DIR_NAME="${DIR_NAME}-${{ matrix.go386 }}"
187+ PKG_NAME="${PKG_NAME}_${{ matrix.go386 }}"
188+ elif [[ -n "${{ matrix.gomips }}" && "${{ matrix.gomips }}" != 'hardfloat' ]]; then
189+ DIR_NAME="${DIR_NAME}-${{ matrix.gomips }}"
190+ PKG_NAME="${PKG_NAME}_${{ matrix.gomips }}"
191+ elif [[ "${{ matrix.legacy_go }}" == 'true' ]]; then
192+ DIR_NAME="${DIR_NAME}-legacy"
193+ fi
174194 echo "DIR_NAME=${DIR_NAME}" >> "${GITHUB_ENV}"
175195 echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}"
196+ echo "OPENWRT_PKG_NAME=${OPENWRT_PKG_NAME}" >> "${GITHUB_ENV}"
176197 PKG_VERSION="${{ needs.calculate_version.outputs.version }}"
177198 PKG_VERSION="${PKG_VERSION//-/\~}"
178199 echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}"
@@ -182,6 +203,7 @@ jobs:
182203 set -xeuo pipefail
183204 sudo gem install fpm
184205 sudo apt-get install -y debsigs
206+ cp .fpm_systemd .fpm
185207 fpm -t deb \
186208 -v "$PKG_VERSION" \
187209 -p "dist/${PKG_NAME}.deb" \
@@ -199,6 +221,7 @@ jobs:
199221 run : |-
200222 set -xeuo pipefail
201223 sudo gem install fpm
224+ cp .fpm_systemd .fpm
202225 fpm -t rpm \
203226 -v "$PKG_VERSION" \
204227 -p "dist/${PKG_NAME}.rpm" \
@@ -218,11 +241,27 @@ jobs:
218241 set -xeuo pipefail
219242 sudo gem install fpm
220243 sudo apt-get install -y libarchive-tools
244+ cp .fpm_systemd .fpm
221245 fpm -t pacman \
222246 -v "$PKG_VERSION" \
223247 -p "dist/${PKG_NAME}.pkg.tar.zst" \
224248 --architecture ${{ matrix.pacman }} \
225249 dist/sing-box=/usr/bin/sing-box
250+ - name : Package OpenWrt
251+ if : matrix.openwrt != ''
252+ run : |-
253+ set -xeuo pipefail
254+ sudo gem install fpm
255+ cp .fpm_openwrt .fpm
256+ fpm -t deb \
257+ -v "$PKG_VERSION" \
258+ -p "dist/openwrt_${PKG_NAME}.deb" \
259+ --architecture all \
260+ dist/sing-box=/usr/bin/sing-box
261+ for architecture in ${{ matrix.openwrt }}; do
262+ .github/deb2ipk.sh "$architecture" "dist/openwrt_${PKG_NAME}.deb" "dist/${OPENWRT_PKG_NAME}_${architecture}.ipk"
263+ done
264+ rm "dist/openwrt_${PKG_NAME}.deb"
226265 - name : Archive
227266 run : |
228267 set -xeuo pipefail
@@ -242,7 +281,7 @@ jobs:
242281 - name : Upload artifact
243282 uses : actions/upload-artifact@v4
244283 with :
245- name : binary-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.legacy_go && '-legacy' || '' }}
284+ name : binary-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.go386 && format('_{0}', matrix.go386) }}${{ matrix.gomips && format('_{0}', matrix.gomips) }}${{ matrix. legacy_go && '-legacy' || '' }}
246285 path : " dist"
247286 build_android :
248287 name : Build Android
0 commit comments