Use official repositories for builds #4
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
--- | |
# Based on https://github.com/glassd00r/Openwrt_Builder/tree/main | |
name: Build OpenWRT for Xiaomi AX3200 | |
on: | |
workflow_dispatch: | |
push: | |
env: | |
REMOTE_REPOSITORY: openwrt/openwrt | |
REMOTE_BRANCH: main | |
RELEASE_PREFIX: Mediatek_mt7622_ax3200 | |
DEVICE_CONFIG: configs/mediatek/mt7622/ax3200 | |
ROLE_CONFIG: configs/common/dumb_ap | |
jobs: | |
build: | |
name: Build OpenWRT for AX3200 | |
runs-on: ubuntu-24.04 | |
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 curl | |
sudo apt full-upgrade -y | |
- name: Checkout remote repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.REMOTE_REPOSITORY }} | |
ref: ${{ env.REMOTE_BRANCH }} | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
with: | |
path: "custom_repo" | |
- name: Update and install feeds | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
- name: Configure firmware image | |
run: | | |
cp custom_repo/${{ env.DEVICE_CONFIG }} .config | |
cat custom_repo/${{ env.ROLE_CONFIG }} >> .config | |
make defconfig | |
- name: Download dependencies | |
run: make -j $(nproc) download | |
- name: Build the firmware image | |
run: make -j $(nproc) world | |
- name: Package output | |
run: tar -cvf ax_3200-images.tar bin/targets/mediatek/mt7622 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ax_3200-images | |
path: ax_3200-images.tar | |
release: | |
name: Create release | |
needs: [build] | |
if: needs.build.result == 'success' | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ax_3200-images | |
- name: Extract artifacts | |
run: tar xf ax_3200-images.tar | |
- name: Get current date | |
run: echo "RELEASE_DATE=$(date +%F)" >> $GITHUB_ENV | |
- name: Create release | |
uses: softprops/action-gh-release@master | |
with: | |
files: bin/targets/mediatek/mt7622/* | |
tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.RELEASE_DATE }} | |
name: Openwrt AX3200 ${{ env.RELEASE_DATE }} | |
body: | | |
Updated prebuilt images for ${{ env.RELEASE_DATE }} | |
Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }} | |
- name: Clean up old releases | |
uses: dev-drprasad/delete-older-releases@master | |
with: | |
keep_latest: 5 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |