Build OpenWrt Firmware - X86 #122
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
# This is a basic workflow to help you get started with Actions | |
name: Build OpenWrt Firmware - X86 | |
# Controls when the workflow will run | |
on: | |
repository_dispatch: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
config: | |
description: 'Input config script file name without ".sh". "all" to build all the configs.' | |
required: true | |
default: configs/x86-openwrt.sh | |
txt: | |
description: Release note txt file name. | |
required: true | |
default: release_note.txt | |
#schedule: | |
# - cron: '* * * * *' | |
env: | |
TZ: 'Asia/Shanghai' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
CONFIG: ${{ github.event.client_payload.config || github.event.inputs.config }} | |
TXT: ${{ github.event.client_payload.txt || github.event.inputs.txt }} | |
steps: | |
- name: Set ENV | |
if: github.event.schedule=='0 21 * * 5' | |
run: | | |
echo "CONFIG=configs/x86-openwrt.sh" >> $GITHUB_ENV | |
echo "TXT=release_note.txt" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Maximize Build Space | |
run: | | |
docker rmi `docker images -q` | |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /usr/lib/jvm /opt/ghc | |
sudo -E apt-get -qq autoremove --purge | |
sudo -E apt-get -qq clean | |
echo "Free space:" | |
df -h | |
- name: Run Build Script | |
uses: ./ | |
with: | |
config: ${{ env.CONFIG }} | |
- name: After Script | |
run: | | |
echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV | |
- name: Upload OpenWrt Firmware to Releases | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: firmware-openwrt-x86_${{ env.PACKAGED_OUTPUTDATE }} | |
files: | | |
${{ github.workspace }}/bin/*.img.gz | |
body_path: ${{ github.workspace }}/configs/${{ env.TXT }} | |
fail_on_unmatched_files: true |