@@ -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,17 @@ 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+ if [[ -n "${{ matrix.goarm }}" ]]; then
181+ DIR_NAME="${DIR_NAME}v${{ matrix.goarm }}"
182+ elif [[ -n "${{ matrix.go386 }}" && "${{ matrix.go386 }}" != 'sse2' ]]; then
183+ DIR_NAME="${DIR_NAME}-${{ matrix.go386 }}"
184+ elif [[ -n "${{ matrix.gomips }}" && "${{ matrix.gomips }}" != 'hardfloat' ]]; then
185+ DIR_NAME="${DIR_NAME}-${{ matrix.gomips }}"
186+ elif [[ "${{ matrix.legacy_go }}" == 'true' ]]; then
187+ DIR_NAME="${DIR_NAME}-legacy"
188+ fi
174189 echo "DIR_NAME=${DIR_NAME}" >> "${GITHUB_ENV}"
175- echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}"
176190 PKG_VERSION="${{ needs.calculate_version.outputs.version }}"
177191 PKG_VERSION="${PKG_VERSION//-/\~}"
178192 echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}"
@@ -182,9 +196,10 @@ jobs:
182196 set -xeuo pipefail
183197 sudo gem install fpm
184198 sudo apt-get install -y debsigs
199+ cp .fpm_systemd .fpm
185200 fpm -t deb \
186201 -v "$PKG_VERSION" \
187- -p "dist/${PKG_NAME }.deb" \
202+ -p "dist/sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.debian } }.deb" \
188203 --architecture ${{ matrix.debian }} \
189204 dist/sing-box=/usr/bin/sing-box
190205 curl -Lo '/tmp/debsigs.diff' 'https://gitlab.com/debsigs/debsigs/-/commit/160138f5de1ec110376d3c807b60a37388bc7c90.diff'
@@ -199,9 +214,10 @@ jobs:
199214 run : |-
200215 set -xeuo pipefail
201216 sudo gem install fpm
217+ cp .fpm_systemd .fpm
202218 fpm -t rpm \
203219 -v "$PKG_VERSION" \
204- -p "dist/${PKG_NAME }.rpm" \
220+ -p "dist/sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.rpm } }.rpm" \
205221 --architecture ${{ matrix.rpm }} \
206222 dist/sing-box=/usr/bin/sing-box
207223 cat > $HOME/.rpmmacros <<EOF
@@ -218,11 +234,27 @@ jobs:
218234 set -xeuo pipefail
219235 sudo gem install fpm
220236 sudo apt-get install -y libarchive-tools
237+ cp .fpm_systemd .fpm
221238 fpm -t pacman \
222239 -v "$PKG_VERSION" \
223- -p "dist/${PKG_NAME }.pkg.tar.zst" \
240+ -p "dist/sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.pacman } }.pkg.tar.zst" \
224241 --architecture ${{ matrix.pacman }} \
225242 dist/sing-box=/usr/bin/sing-box
243+ - name : Package OpenWrt
244+ if : matrix.openwrt != ''
245+ run : |-
246+ set -xeuo pipefail
247+ sudo gem install fpm
248+ cp .fpm_openwrt .fpm
249+ fpm -t deb \
250+ -v "$PKG_VERSION" \
251+ -p "dist/openwrt.deb" \
252+ --architecture all \
253+ dist/sing-box=/usr/bin/sing-box
254+ for architecture in ${{ matrix.openwrt }}; do
255+ .github/deb2ipk.sh "$architecture" "dist/openwrt.deb" "dist/sing-box_${{ needs.calculate_version.outputs.version }}_openwrt_${architecture}.ipk"
256+ done
257+ rm "dist/openwrt.deb"
226258 - name : Archive
227259 run : |
228260 set -xeuo pipefail
@@ -242,7 +274,7 @@ jobs:
242274 - name : Upload artifact
243275 uses : actions/upload-artifact@v4
244276 with :
245- name : binary-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.legacy_go && '-legacy' || '' }}
277+ 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' || '' }}
246278 path : " dist"
247279 build_android :
248280 name : Build Android
0 commit comments