102 lines
2.9 KiB
YAML
102 lines
2.9 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 stable 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)
|
|
if [ -z "$VERSION" ]; then
|
|
echo "ERROR: Could not resolve a stable OpenWrt 25.12.x version"
|
|
exit 1
|
|
fi
|
|
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/msm8916
|
|
|
|
- name: Update and install feeds
|
|
run: |
|
|
cd openwrt
|
|
rm -rf tmp
|
|
./scripts/feeds update -a
|
|
./scripts/feeds install -a
|
|
|
|
- name: Configure and download
|
|
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 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 artifacts
|
|
run: |
|
|
mkdir -p artifacts
|
|
for pkg in $PACKAGES; do
|
|
find openwrt/bin/packages -name "${pkg}*.apk" -exec cp {} artifacts/ \;
|
|
done
|
|
|
|
- name: Upload packages
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: packages_${{ env.OPENWRT_VERSION }}_${{ env.FILE_DATE }}
|
|
path: artifacts/
|