Build AX3600 NSS #300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build AX3600 NSS | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
required: true | |
type: string | |
default: "qualcommax-6.x-nss-wifi" | |
jobs: | |
build: | |
name: Prepare and build AX3600 NSS generic images | |
runs-on: ubuntu-24.04 | |
permissions: write-all | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y \ | |
build-essential clang flex bison g++ gawk \ | |
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \ | |
python3-setuptools rsync swig unzip zlib1g-dev file wget | |
sudo apt full-upgrade -y | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
root-reserve-mb: 8192 | |
temp-reserve-mb: 2048 | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
- name: show space | |
run: | | |
df -h | |
- name: Checkout | |
uses: actions/checkout@v4 | |
id: octokit | |
- name: Pull OpenWrt source | |
uses: actions/checkout@v4 | |
with: | |
repository: qosmio/openwrt-ipq | |
ref: ${{ inputs.branch }} | |
path: openwrt | |
- name: Make cache paths | |
run: | | |
set -e | |
cd openwrt | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
ls $GITHUB_WORKSPACE/patches | xargs -I {} git apply -v $GITHUB_WORKSPACE/patches/{} | |
git rev-parse --short HEAD > ../lastest-commit | |
mkdir -p {dl,build_dir,staging_dir} | |
- uses: actions/cache@v4 | |
name: Cache | |
with: | |
path: | | |
openwrt/dl | |
openwrt/build_dir | |
openwrt/staging_dir | |
key: cache-key-${{ github.run_id }} | |
restore-keys: | | |
cache-key | |
- name: Prepare | |
run: | | |
set -e | |
mv openwrt.sh openwrt | |
cd openwrt | |
bash openwrt.sh | |
mkdir files | |
ls $GITHUB_WORKSPACE/files/ | xargs -I "{}" cp -rf $GITHUB_WORKSPACE/files/{} files/ | |
- name: Update and install feeds | |
run: | | |
set -e | |
cd openwrt | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
cd feeds/luci | |
ls $GITHUB_WORKSPACE/luci_patches | xargs -I {} git apply -v $GITHUB_WORKSPACE/luci_patches/{} | |
- name: Download package sources | |
run: | | |
set -e | |
mv .full_config openwrt/.config | |
cd openwrt | |
make defconfig V=s | |
make download V=s | |
- name: Build tools | |
run: | | |
cd openwrt | |
make tools/install -j $(($(nproc)+1)) V=s || \ | |
make tools/install V=s | |
- name: Build toolchain | |
run: | | |
cd openwrt | |
make toolchain/install -j $(($(nproc)+1)) V=s || \ | |
make toolchain/install V=s | |
- name: Build target images | |
run: | | |
cd openwrt | |
make -j $(($(nproc)+1)) V=s || \ | |
make V=s | |
- name: Get revision | |
run: | | |
cd openwrt | |
echo "Repository URL: $(git config --get remote.origin.url)" >> bodyFile | |
echo "Git Reference: $(git rev-parse --abbrev-ref HEAD)" >> bodyFile | |
echo "SHA: $(git log -1 --format='%H')" >> bodyFile | |
export BASE_D=$PWD | |
for feed in feeds/*; do if [ -d "$feed/.git" ]; then cd $feed; echo "$feed: $(git rev-parse HEAD)" >> $BASE_D/bodyFile; cd $BASE_D; fi; done | |
- name: TAR output | |
run: | | |
cp openwrt/bodyFile openwrt/bin/targets/qualcommax/ipq807x/bodyFile | |
cp openwrt/.config openwrt/bin/targets/qualcommax/ipq807x/buildconfig | |
tar -cvf ipq807xx-images.tar openwrt/bin/targets/ | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ipq807x-images | |
path: ipq807xx-images.tar | |
- name: Clean for cache | |
run: | | |
cd openwrt | |
make clean V=s | |
- name: Cleanup old cache | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh extension install actions/gh-actions-cache | |
REPO=${{ github.repository }} | |
BRANCH=master | |
echo "Fetching list of cache key" | |
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) | |
## Setting this to not fail the workflow while deleting cache keys. | |
set +e | |
echo "Deleting caches..." | |
for cacheKey in $cacheKeysForPR | |
do | |
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | |
done | |
echo "Done" | |
release: | |
name: Make a release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download the image artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ipq807x-images | |
- name: Extract the image artifacts | |
run: tar xf ipq807xx-images.tar | |
- name: Get the current date | |
run: echo "NOW=$(date +%F-%H%M)" >> $GITHUB_ENV | |
- name: Create a release | |
uses: "ncipollo/release-action@v1" | |
with: | |
name: "Updated prebuilt images ${{ env.NOW }}" | |
tag: "ax3600-${{ env.NOW }}" | |
makeLatest: true | |
bodyFile: openwrt/bin/targets/qualcommax/ipq807x/bodyFile | |
artifacts: openwrt/bin/targets/qualcommax/ipq807x/* | |
token: "${{ secrets.GITHUB_TOKEN }}" | |