sbwml 51b4b7a98b ci: use upx compress /usr/bin/openlist with LZMA (--best)
Signed-off-by: sbwml <admin@cooluc.com>
2025-06-17 17:16:36 +08:00

96 lines
2.8 KiB
YAML

name: Build Packages
on:
push:
tags:
- "*"
jobs:
build:
name: Build ${{ matrix.arch }}-${{ matrix.sdk }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- aarch64_cortex-a53
- aarch64_cortex-a72
- aarch64_cortex-a76
- aarch64_generic
- arm_arm1176jzf-s_vfp
- arm_arm926ej-s
- arm_cortex-a15_neon-vfpv4
- arm_cortex-a5_vfpv4
- arm_cortex-a7
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a7_vfpv4
- arm_cortex-a8_vfpv3
- arm_cortex-a9
- arm_cortex-a9_neon
- arm_cortex-a9_vfpv3-d16
- arm_fa526
- arm_xscale
- i386_pentium-mmx
- i386_pentium4
- loongarch64_generic
- mips64_mips64r2
- mips64_octeonplus
- mips64el_mips64r2
- mips_24kc
- mips_4kec
- mips_mips32
- mipsel_24kc
- mipsel_24kc_24kf
- mipsel_74kc
- mipsel_mips32
- riscv64_riscv64
- x86_64
sdk:
- openwrt-24.10
- SNAPSHOT
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build with Static Linking
run: |
sed -i '/golang-package/a \\tGO_PKG_DEFAULT_LDFLAGS:=-w -s -extldflags "-static"' openlist/Makefile
- name: UPX Compress
if: ${{ matrix.arch != 'loongarch64_generic' && matrix.arch != 'mips64_mips64r2' && matrix.arch != 'mips64_octeonplus' && matrix.arch != 'mips64el_mips64r2' && matrix.arch != 'riscv64_riscv64' }}
run: |
sed -i '/INSTALL_DATA/a \\t/usr/bin/upx --lzma --best $(1)\/usr\/bin\/openlist' openlist/Makefile
- name: Build Packages
uses: sbwml/openwrt-gh-action-sdk@go1.25
env:
ARCH: ${{ matrix.arch }}-${{ matrix.sdk }}
FEEDNAME: packages_ci
PACKAGES: luci-app-openlist
NO_REFRESH_CHECK: true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}-${{ matrix.sdk }}
path: |
bin/packages/${{ matrix.arch }}/packages_ci/*.apk
bin/packages/${{ matrix.arch }}/packages_ci/*.ipk
- name: Create compress files
continue-on-error: true
run: |
tar -zcvf ${{ matrix.sdk }}-${{ matrix.arch }}.tar.gz -C bin/packages/${{ matrix.arch }}/ packages_ci
- name: Upload packages
uses: ncipollo/release-action@v1
with:
name: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
replacesArtifacts: true
prerelease: false
artifacts: "${{ matrix.sdk }}-${{ matrix.arch }}.tar.gz"