Files
msm8916-openwrt/.github/workflows/build-package.yml
T
Miguel FuertesandClaude Opus 4.6 e89f2c8bfb Replace git patch with portable shell script and parameterize OpenWrt version
- Convert enable_wcn36xx_mac80211.patch to apply_patches.sh (sed + heredoc)
  for cross-version compatibility (old patch moved to TBR/)
- GHA workflows auto-resolve latest OpenWrt 25.12.x tag via git ls-remote
- Unify build.yml and build-all.yml into single workflow with dynamic matrix
- Local dev (Dockerfile/docker-compose) defaults to main (snapshot)
- Remove target-specific APK feed on first boot (msm89xx not on downloads.openwrt.org)
- Make LuCI odhcpd fix conditional
- Update README with new build instructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 16:52:14 +02:00

122 lines
3.5 KiB
YAML

name: Build Packages
on:
workflow_dispatch:
env:
TZ: Europe/Madrid
PACKAGES: >-
luci-app-tailscale
uci-usb-gadget
luci-app-usb-gadget
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Resolve latest OpenWrt 25.12.x tag
id: resolve
run: |
VERSION=$(git ls-remote --tags https://git.openwrt.org/openwrt/openwrt.git 'v25.12.*' \
| grep -oP 'v25\.12\.\d+$' | sort -V | tail -1)
echo "Resolved OpenWrt version: $VERSION"
echo "OPENWRT_VERSION=$VERSION" >> $GITHUB_ENV
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo -E apt-get -qq update
sudo -E ./devenv/dependencies.sh
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
- name: Clone OpenWrt source code
run: |
echo "Using OpenWrt ${{ env.OPENWRT_VERSION }}"
git clone https://git.openwrt.org/openwrt/openwrt.git openwrt
git -C openwrt checkout ${{ env.OPENWRT_VERSION }}
- name: Load msm89xx target and packages
run: |
chmod +x apply_patches.sh && ./apply_patches.sh openwrt
mv msm89xx openwrt/target/linux/msm89xx
mv packages openwrt/package/uz801
- name: Update and install feeds
run: |
cd openwrt
rm -rf tmp
./scripts/feeds update -a
./scripts/feeds install -a
- name: Configure for package build (APK)
run: |
cd openwrt
cp ../diffconfig_uz801 .config
echo "CONFIG_PACKAGE_tailscale=y" >> .config
echo "CONFIG_PACKAGE_luci-app-tailscale=y" >> .config
make defconfig
make download -j8
find dl -size -1024c -exec rm -f {} \; || true
- name: Build toolchain and dependencies
run: |
cd openwrt
make tools/install -j$(nproc)
make toolchain/install -j$(nproc)
make target/linux/compile -j$(nproc) V=s
- name: Build APK packages
run: |
cd openwrt
for pkg in $PACKAGES; do
make package/${pkg}/compile -j$(nproc) V=s
done
echo "FILE_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Collect APK artifacts
run: |
mkdir -p artifacts/apk
for pkg in $PACKAGES; do
find openwrt/bin/packages -name "${pkg}*.apk" -exec cp {} artifacts/apk/ \;
done
- name: Reconfigure for IPK
run: |
cd openwrt
cp ../diffconfig_uz801 .config
echo "CONFIG_PACKAGE_tailscale=y" >> .config
echo "CONFIG_PACKAGE_luci-app-tailscale=y" >> .config
echo "# CONFIG_USE_APK is not set" >> .config
make defconfig
for pkg in $PACKAGES; do
make package/${pkg}/{clean,compile} -j$(nproc) V=s
done
- name: Collect IPK artifacts
run: |
mkdir -p artifacts/ipk
for pkg in $PACKAGES; do
find openwrt/bin/packages -name "${pkg}*.ipk" -exec cp {} artifacts/ipk/ \;
done
- name: Upload APK packages
uses: actions/upload-artifact@v4
with:
name: packages_apk_${{ env.FILE_DATE }}
path: artifacts/apk/
- name: Upload IPK packages
uses: actions/upload-artifact@v4
with:
name: packages_ipk_${{ env.FILE_DATE }}
path: artifacts/ipk/