generated from P3TERX/Actions-OpenWrt
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Stable builds and Nightly builds
- Loading branch information
Showing
8 changed files
with
545 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# | ||
# https://github.com/P3TERX/Actions-OpenWrt | ||
# | ||
# File: .github/workflows/immortalwrt-builder.yml | ||
# File: .github/workflows/immortalwrt-builder-nightly.yml | ||
# Description: Build ImmortalWRT using GitHub Actions | ||
# | ||
# Copyright (c) 2019-2024 P3TERX <https://p3terx.com> | ||
# Copyright (c) 2024 SuperKali <[email protected]> | ||
# Copyright (c) 2024-2025 SuperKali <[email protected]> | ||
# | ||
# This is free software, licensed under the MIT License. | ||
# See /LICENSE for more information. | ||
|
||
name: BananaWRT Builder | ||
name: BananaWRT Builder (Nightly) | ||
on: | ||
repository_dispatch: | ||
workflow_dispatch: | ||
|
@@ -21,7 +21,7 @@ env: | |
REPO_URL: https://github.com/immortalwrt/immortalwrt | ||
REPO_BRANCH: 24.10.0-rc3 | ||
FEEDS_CONF: feeds.conf.default | ||
CONFIG_FILE: .config | ||
CONFIG_FILE: config/nightly/.config | ||
DIY_P1_SH: diy-part1.sh | ||
DIY_P2_SH: diy-part2.sh | ||
UPLOAD_BIN_DIR: false | ||
|
@@ -159,8 +159,10 @@ jobs: | |
release_date=$(date +'%Y.%m.%d-%H%M') | ||
kernel_version=$(find ${{ runner.workspace }}/immortalwrt/build_dir/target-*/linux-*/ -type d -regex '.*/linux-[0-9]+\.[0-9]+.*' | head -n 1 | sed -E 's|.*/linux-||') | ||
target_devices=$(grep '^CONFIG_TARGET.*DEVICE.*=y' ${{ runner.workspace }}/immortalwrt/.config | sed -r 's/.*DEVICE_(.*)=y/\1/') | ||
release_type='Nightly' | ||
sed -e "s|{{BANANAWRT_KERNEL}}|${kernel_version}|g" \ | ||
-e "s|{{RELEASE_TYPE}}|${release_type}|g" \ | ||
-e "s|{{BANANAWRT_VERSION}}|${REPO_BRANCH}|g" \ | ||
-e "s|{{RELEASE_DATE}}|$(date '+%Y-%m-%d %H:%M:%S')|g" \ | ||
-e "s|{{TARGET_DEVICES}}|${target_devices}|g" \ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# Description: Build ImmortalWRT (Self Hosted) using GitHub Actions | ||
# | ||
# Copyright (c) 2019-2024 P3TERX <https://p3terx.com> | ||
# Copyright (c) 2024 SuperKali <[email protected]> | ||
# Copyright (c) 2024-2025 SuperKali <[email protected]> | ||
# | ||
# This is free software, licensed under the MIT License. | ||
# See /LICENSE for more information. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
# | ||
# https://github.com/P3TERX/Actions-OpenWrt | ||
# | ||
# File: .github/workflows/immortalwrt-builder-stable.yml | ||
# Description: Build ImmortalWRT using GitHub Actions | ||
# | ||
# Copyright (c) 2019-2024 P3TERX <https://p3terx.com> | ||
# Copyright (c) 2024-2025 SuperKali <[email protected]> | ||
# | ||
# This is free software, licensed under the MIT License. | ||
# See /LICENSE for more information. | ||
|
||
name: BananaWRT Builder (Stable) | ||
on: | ||
repository_dispatch: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 0 1 * * | ||
|
||
env: | ||
REPO_URL: https://github.com/immortalwrt/immortalwrt | ||
REPO_BRANCH: 24.10.0-rc3 | ||
FEEDS_CONF: feeds.conf.default | ||
CONFIG_FILE: config/stable/.config | ||
DIY_P1_SH: diy-part1.sh | ||
DIY_P2_SH: diy-part2.sh | ||
UPLOAD_BIN_DIR: false | ||
UPLOAD_FIRMWARE: true | ||
UPLOAD_RELEASE: true | ||
TZ: Europe/Rome | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/[email protected] | ||
|
||
- name: Set Up Build 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 apt-get -qq update | ||
sudo apt-get -qq install -y \ | ||
ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ | ||
bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext \ | ||
gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 \ | ||
libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev \ | ||
libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev \ | ||
libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch \ | ||
pkgconf python2.7 python3 python3-pyelftools python3-setuptools qemu-utils \ | ||
rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ | ||
vim wget xmlto xxd zlib1g-dev | ||
sudo apt-get -qq autoremove --purge -y | ||
sudo apt-get -qq clean | ||
- name: Set timezone on the host | ||
run: sudo timedatectl set-timezone "$TZ" || echo "Failed to set timezone, proceeding anyway." | ||
|
||
- name: Authenticate GitHub | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
echo "machine github.com login ${{ secrets.PERSONAL_ACCESS_TOKEN }}" > ~/.netrc | ||
chmod 600 ~/.netrc | ||
- name: Clone ImmortalWRT Repository | ||
working-directory: ${{ runner.workspace }} | ||
run: | | ||
git clone $REPO_URL -b v"$REPO_BRANCH" immortalwrt | ||
- name: Apply Custom Feeds Configuration | ||
run: | | ||
[ -e ${{ env.FEEDS_CONF }} ] && mv ${{ env.FEEDS_CONF }} ${{ runner.workspace }}/immortalwrt/feeds.conf.default | ||
chmod +x ${{ env.DIY_P1_SH }} | ||
cd ${{ runner.workspace }}/immortalwrt | ||
$GITHUB_WORKSPACE/${{ env.DIY_P1_SH }} | ||
- name: Add Custom DTS Files | ||
run: | | ||
cp -r dts/* ${{ runner.workspace }}/immortalwrt/target/linux/mediatek/dts/ | ||
- name: Update Package Feeds | ||
run: | | ||
cd ${{ runner.workspace }}/immortalwrt | ||
./scripts/feeds update -a | ||
- name: Install Package Feeds | ||
run: | | ||
cd ${{ runner.workspace }}/immortalwrt | ||
./scripts/feeds install -a | ||
- name: Apply Custom Configuration | ||
run: | | ||
[ -e files ] && mv files ${{ runner.workspace }}/immortalwrt/files | ||
[ -e ${{ env.CONFIG_FILE }} ] && mv ${{ env.CONFIG_FILE }} ${{ runner.workspace }}/immortalwrt/.config | ||
chmod +x ${{ env.DIY_P2_SH }} | ||
cd ${{ runner.workspace }}/immortalwrt | ||
$GITHUB_WORKSPACE/${{ env.DIY_P2_SH }} | ||
./scripts/feeds install -p additional_pack -a | ||
- name: Diffconfig with current configuration | ||
run: | | ||
cd ${{ runner.workspace }}/immortalwrt | ||
./scripts/diffconfig.sh > diffconfig | ||
curl https://downloads.immortalwrt.org/releases/$REPO_BRANCH/targets/mediatek/filogic/config.buildinfo | ||
cat diffconfig >> config.buildinfo | ||
mv config.buildinfo .config | ||
[ -n "$REPO_BRANCH" ] && sed -i \ | ||
-e 's|^CONFIG_VERSION_REPO=.*|CONFIG_VERSION_REPO="https://downloads.immortalwrt.org/releases/'"$REPO_BRANCH"'"|g' \ | ||
.config | ||
- name: Download Required Packages | ||
run: | | ||
cd ${{ runner.workspace }}/immortalwrt | ||
make defconfig | ||
make download -j$(nproc) | ||
find dl -size -1024c -exec ls -l {} \; | ||
find dl -size -1024c -exec rm -f {} \; | ||
- name: Build Firmware | ||
run: | | ||
cd ${{ runner.workspace }}/immortalwrt | ||
make -j$(nproc) || make -j1 V=s | ||
grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME | ||
echo "FILE_DATE=$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV | ||
- name: Check Disk Usage | ||
run: df -hT | ||
|
||
- name: Upload Binary Files | ||
if: env.UPLOAD_BIN_DIR == 'true' | ||
uses: actions/[email protected] | ||
with: | ||
name: BananaWRT_bin${{ env.FILE_DATE }} | ||
path: ${{ runner.workspace }}/immortalwrt/bin | ||
|
||
- name: Prepare Firmware for Upload | ||
run: | | ||
cd ${{ runner.workspace }}/immortalwrt/bin/targets/*/* | ||
rm -rf packages | ||
echo "FIRMWARE=$PWD" >> $GITHUB_ENV | ||
- name: Upload Firmware Files | ||
if: env.UPLOAD_FIRMWARE == 'true' | ||
uses: actions/[email protected] | ||
with: | ||
name: BananaWRT_firmware${{ env.FILE_DATE }} | ||
path: ${{ env.FIRMWARE }} | ||
|
||
- name: Create Release Tag | ||
if: env.UPLOAD_RELEASE == 'true' | ||
run: | | ||
release_date=$(date +'%Y.%m.%d-%H%M') | ||
kernel_version=$(find ${{ runner.workspace }}/immortalwrt/build_dir/target-*/linux-*/ -type d -regex '.*/linux-[0-9]+\.[0-9]+.*' | head -n 1 | sed -E 's|.*/linux-||') | ||
target_devices=$(grep '^CONFIG_TARGET.*DEVICE.*=y' ${{ runner.workspace }}/immortalwrt/.config | sed -r 's/.*DEVICE_(.*)=y/\1/') | ||
release_type='Stable' | ||
sed -e "s|{{BANANAWRT_KERNEL}}|${kernel_version}|g" \ | ||
-e "s|{{RELEASE_TYPE}}|${release_type}|g" \ | ||
-e "s|{{BANANAWRT_VERSION}}|${REPO_BRANCH}|g" \ | ||
-e "s|{{RELEASE_DATE}}|$(date '+%Y-%m-%d %H:%M:%S')|g" \ | ||
-e "s|{{TARGET_DEVICES}}|${target_devices}|g" \ | ||
templates/release-notes-template.md > release.txt | ||
echo "release_tag=${release_date}" >> $GITHUB_ENV | ||
- name: Publish Firmware Release | ||
if: env.UPLOAD_RELEASE == 'true' | ||
uses: softprops/[email protected] | ||
with: | ||
tag_name: ${{ env.release_tag }} | ||
body_path: release.txt | ||
files: ${{ env.FIRMWARE }}/* | ||
|
||
- name: Remove old Releases | ||
uses: dev-drprasad/[email protected] | ||
if: env.UPLOAD_RELEASE == 'true' && !cancelled() | ||
with: | ||
keep_latest: 7 | ||
delete_tags: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Delete workflow runs | ||
uses: Mattraks/[email protected] | ||
with: | ||
retain_days: 0 | ||
keep_minimum_runs: 7 | ||
|
||
- name: Cleanup Workspace | ||
if: always() | ||
run: | | ||
sudo rm -rf ~/.netrc | ||
sudo rm -rf "${{ runner.workspace }}/immortalwrt" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# File: .github/workflows/immortalwrt-checker.yml | ||
# Description: Bump ImmortalWRT Version using GitHub Actions | ||
# | ||
# Copyright (c) 2024 SuperKali <[email protected]> | ||
# Copyright (c) 2024-2025 SuperKali <[email protected]> | ||
# | ||
# This is free software, licensed under the MIT License. | ||
# See /LICENSE for more information. | ||
|
@@ -45,7 +45,7 @@ jobs: | |
exit 1 | ||
fi | ||
files_to_update=() | ||
for file in .github/workflows/immortalwrt-builder*.yml; do | ||
for file in .github/workflows/immortalwrt-builder*{selfhost,nightly}*.yml; do | ||
if [ -f "$file" ]; then | ||
file_version=$(grep -m 1 'REPO_BRANCH:' "$file" | awk -F': ' '{if (NF > 1) {gsub(/^ +| +$/, "", $2); print $2}}') | ||
if [ "$file_version" != "${{ env.latest_version }}" ]; then | ||
|
@@ -81,7 +81,7 @@ jobs: | |
id: check_config_repo | ||
run: | | ||
latest_repo="https://downloads.immortalwrt.org/releases/${{ env.latest_version }}" | ||
current_repo=$(grep -oP '^CONFIG_VERSION_REPO=\K.*' .config) | ||
current_repo=$(grep -oP '^CONFIG_VERSION_REPO=\K.*' config/nightly/.config) | ||
if [ "$current_repo" != "\"$latest_repo\"" ]; then | ||
echo "CONFIG_VERSION_REPO in .config needs update: $current_repo -> $latest_repo" | ||
echo "config_repo_needs_update=true" >> $GITHUB_ENV | ||
|
@@ -94,7 +94,7 @@ jobs: | |
if: env.config_repo_needs_update == 'true' | ||
run: | | ||
latest_repo="https://downloads.immortalwrt.org/releases/${{ env.latest_version }}" | ||
sed -i 's|^CONFIG_VERSION_REPO=.*|CONFIG_VERSION_REPO="'"$latest_repo"'"|g' .config | ||
sed -i 's|^CONFIG_VERSION_REPO=.*|CONFIG_VERSION_REPO="'"$latest_repo"'"|g' config/nightly/.config | ||
echo "Updated CONFIG_VERSION_REPO in .config to $latest_repo." | ||
- name: Check VERSION in scripts/update-script.sh | ||
|
@@ -138,8 +138,8 @@ jobs: | |
- Updated `VERSION` in `scripts/update-script.sh`. | ||
{% endif %} | ||
Labels: bump, immortalwrt, v${{ env.latest_version }} | ||
labels: bump, immortalwrt, v${{ env.latest_version }} | ||
Labels: bump, immortalwrt, nightly, v${{ env.latest_version }} | ||
labels: bump, immortalwrt, nightly, v${{ env.latest_version }} | ||
|
||
- name: Delete workflow runs | ||
uses: Mattraks/[email protected] | ||
|
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
File renamed without changes.
Oops, something went wrong.