Build #2675
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 | |
on: | |
schedule: | |
- cron: 0 0/6 * * * | |
workflow_dispatch: | |
inputs: | |
runner_image: | |
description: "Runner Image" | |
required: true | |
type: string | |
default: "ubuntu-latest" | |
debug_with_ssh: | |
description: "Debug with SSH" | |
type: boolean | |
default: false | |
upload_to_server: | |
description: "Upload firmware to file server" | |
type: boolean | |
default: false | |
clean_build: | |
description: "Skip use cache and clean cache" | |
type: boolean | |
default: false | |
jobs: | |
lede-x86_64: | |
runs-on: ${{ github.event.inputs.runner_image || 'ubuntu-latest' }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 0 | |
- name: Prepare Environment and Save Build Configs | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
bash prenv.sh | |
cp lede/x86_64 /tmp/.config | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
repository: coolsnowwolf/lede | |
fetch-depth: 0 | |
ref: master | |
- name: Cache | |
uses: stupidloud/cachewrtbuild@main | |
with: | |
ccache: true | |
mixkey: "lede_x86_64" | |
skip: ${{ ! github.event.inputs.clean_build || true }} | |
clean: ${{ github.event.inputs.clean_build || false }} | |
- name: Download and Load custom configuration | |
run: | | |
echo -e 'CONFIG_DEVEL=y\nCONFIG_CCACHE=y' >> .config | |
./scripts/feeds update -a && ./scripts/feeds install -a | |
cp /tmp/.config .config | |
make defconfig clean | |
- name: Try to Build When Multi-core compile failure will be rollback to Single core compile | |
run: | | |
echo "Will be use $(nproc) thread compile" | |
sudo df -h | |
make -j$(nproc) || make -j1 V=99 | |
sudo df -h | |
- name: Prepare Image Artifact | |
if: success() | |
run: | | |
mkdir -p images | |
cp -r bin/targets/*/*/*.gz images/ | |
cp -r bin/targets/*/*/sha256sums images/ | |
- name: Upload Artifact Images | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
compression-level: 9 | |
include-hidden-files: true | |
name: lede-x86_64-images | |
path: images | |
- name: Prepare Packages Artifact | |
if: success() | |
run: | | |
mkdir -p pkgs | |
cp -r bin/targets/*/*/packages/* pkgs/ | |
- name: Upload Artifact Packages | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
name: lede-x86_64-packages | |
path: pkgs | |
- name: Upload firmware to Download Station | |
if: ${{ github.event.inputs.upload_to_server || false }} && success() | |
run: | | |
cd bin/targets/*/* | |
zip -r -o -q -9 file.zip . -i *.gz | |
[[ -f file.zip ]] && curl -F "token=${{ secrets.UPLOAD_TOKEN }}" -F "location=Router/lede/x86_64" -F "[email protected]" ${{ secrets.MAIN_UPLOAD_PROCESSOR }} | |
openwrt-x86_64: | |
runs-on: ${{ github.event.inputs.runner_image || 'ubuntu-latest' }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 0 | |
- name: Prepare Environment and Save Build Configs | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
bash prenv.sh | |
cp openwrt/x86_64 /tmp/.config | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
repository: openwrt/openwrt | |
fetch-depth: 0 | |
ref: main | |
- name: Cache | |
uses: stupidloud/cachewrtbuild@main | |
with: | |
ccache: true | |
mixkey: "openwrt_x86_64" | |
skip: ${{ ! github.event.inputs.clean_build || true }} | |
clean: ${{ github.event.inputs.clean_build || false }} | |
- name: Download and Load custom configuration | |
run: | | |
echo -e 'CONFIG_DEVEL=y\nCONFIG_CCACHE=y' >> .config | |
rm -rf package/helloworld | |
git clone --depth=1 https://github.com/fw876/helloworld.git package/helloworld | |
./scripts/feeds update -a && ./scripts/feeds install -a | |
cp /tmp/.config .config | |
make defconfig clean | |
- name: Try to Build When Multi-core compile failure will be rollback to Single core compile | |
run: | | |
echo "Will be use $(nproc) thread compile" | |
sudo df -h | |
make -j$(nproc) || make -j1 V=99 | |
sudo df -h | |
- name: Prepare Image Artifact | |
if: success() | |
run: | | |
mkdir -p images | |
cp -r bin/targets/*/*/*.gz images/ | |
cp -r bin/targets/*/*/sha256sums images/ | |
- name: Upload Artifact Images | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
compression-level: 9 | |
include-hidden-files: true | |
name: openwrt_x86_64-images | |
path: images | |
- name: Prepare Packages Artifact | |
if: success() | |
run: | | |
mkdir -p pkgs | |
cp -r bin/targets/*/*/packages pkgs/ | |
- name: Upload Artifact Packages | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
name: openwrt_x86_64-packages | |
path: pkgs | |
- name: Upload firmware to Download Station | |
if: ${{ github.event.inputs.upload_to_server || false }} && success() | |
run: | | |
cd bin/targets/*/* | |
zip -r -o -q -9 file.zip . -i *.gz | |
[[ -f file.zip ]] && curl -F "token=${{ secrets.UPLOAD_TOKEN }}" -F "location=Router/openwrt/x86_64" -F "[email protected]" ${{ secrets.MAIN_UPLOAD_PROCESSOR }} | |
immortalwrt-x86_64: | |
runs-on: ${{ github.event.inputs.runner_image || 'ubuntu-latest' }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 0 | |
- name: Prepare Environment and Save Build Configs | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
bash prenv.sh | |
cp immortalwrt/x86_64 /tmp/.config | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
repository: immortalwrt/immortalwrt | |
fetch-depth: 0 | |
ref: master | |
- name: Cache | |
uses: stupidloud/cachewrtbuild@main | |
with: | |
ccache: true | |
mixkey: "immortalwrt_x86_64" | |
skip: ${{ ! github.event.inputs.clean_build || true }} | |
clean: ${{ github.event.inputs.clean_build || false }} | |
- name: Download and Load custom configuration | |
run: | | |
echo -e 'CONFIG_DEVEL=y\nCONFIG_CCACHE=y' >> .config | |
rm -rf package/helloworld | |
git clone --depth=1 https://github.com/fw876/helloworld.git package/helloworld | |
./scripts/feeds update -a && ./scripts/feeds install -a | |
cp /tmp/.config .config | |
make defconfig clean | |
- name: Try to Build When Multi-core compile failure will be rollback to Single core compile | |
run: | | |
echo "Will be use $(nproc) thread compile" | |
sudo df -h | |
make -j$(nproc) || make -j1 V=99 | |
sudo df -h | |
- name: Prepare Image Artifact | |
if: success() | |
run: | | |
mkdir -p images | |
cp -r bin/targets/*/*/*.gz images/ | |
cp -r bin/targets/*/*/sha256sums images/ | |
- name: Upload Artifact Images | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
compression-level: 9 | |
include-hidden-files: true | |
name: immortalwrt_x86_64-images | |
path: images | |
- name: Prepare Packages Artifact | |
if: success() | |
run: | | |
mkdir -p pkgs | |
cp -r bin/targets/*/*/packages pkgs/ | |
- name: Upload Artifact Packages | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
name: immortalwrt_x86_64-packages | |
path: pkgs | |
- name: Upload firmware to Download Station | |
if: ${{ github.event.inputs.upload_to_server || false }} && success() | |
run: | | |
cd bin/targets/*/* | |
zip -r -o -q -9 file.zip . -i *.gz | |
[[ -f file.zip ]] && curl -F "token=${{ secrets.UPLOAD_TOKEN }}" -F "location=Router/immortalwrt/x86_64" -F "[email protected]" ${{ secrets.MAIN_UPLOAD_PROCESSOR }} | |
immortalwrt-rm2100: | |
runs-on: ${{ github.event.inputs.runner_image || 'ubuntu-latest' }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 0 | |
- name: Prepare Environment and Save Build Configs | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
bash prenv.sh | |
cp immortalwrt/rm2100 /tmp/.config | |
- name: Checkout repo | |
uses: actions/checkout@main | |
with: | |
repository: immortalwrt/immortalwrt | |
fetch-depth: 0 | |
ref: master | |
- name: Cache | |
uses: stupidloud/cachewrtbuild@main | |
with: | |
ccache: true | |
mixkey: "immortalwrt_rm2100" | |
skip: ${{ ! github.event.inputs.clean_build || true }} | |
clean: ${{ github.event.inputs.clean_build || false }} | |
- name: Download and Load custom configuration | |
run: | | |
echo -e 'CONFIG_DEVEL=y\nCONFIG_CCACHE=y' >> .config | |
./scripts/feeds update -a && ./scripts/feeds install -a | |
cp /tmp/.config .config | |
make defconfig clean | |
- name: Try to Build When Multi-core compile failure will be rollback to Single core compile | |
run: | | |
echo "Will be use $(nproc) thread compile" | |
sudo df -h | |
make -j$(nproc) || make -j1 V=99 | |
sudo df -h | |
- name: Prepare Image Artifact | |
if: success() | |
run: | | |
mkdir -p images | |
cp -r bin/targets/*/*/*.bin images/ | |
cp -r bin/targets/*/*/sha256sums images/ | |
- name: Upload Artifact Images | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
compression-level: 9 | |
include-hidden-files: true | |
name: immortalwrt_ramips_mt7621-images | |
path: images | |
- name: Prepare Packages Artifact | |
if: success() | |
run: | | |
mkdir -p pkgs | |
cp -r bin/targets/*/*/packages pkgs/ | |
- name: Upload Artifact Packages | |
if: success() | |
uses: actions/upload-artifact@main | |
with: | |
name: immortalwrt_ramips_mt7621-packages | |
path: pkgs | |
- name: Upload firmware to Download Station | |
if: ${{ github.event.inputs.upload_to_server || false }} && success() | |
run: | | |
cd bin/targets/*/* | |
zip -r -o -q -9 file.zip . -i *.gz | |
[[ -f file.zip ]] && curl -F "token=${{ secrets.UPLOAD_TOKEN }}" -F "location=Router/immortalwrt/RM2100" -F "[email protected]" ${{ secrets.MAIN_UPLOAD_PROCESSOR }} |