Build_avaota-op #6
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_avaota-op | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
prepare_release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get time | |
id: time | |
uses: nanzm/[email protected] | |
with: | |
format: 'YYYYMMDD-HHmm' | |
- name: Create empty release | |
id: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.time.outputs.time }} | |
body_path: README.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
target_commitish: openwrt-23.05 | |
draft: false | |
outputs: | |
release_id: ${{ steps.release.outputs.id }} | |
build: | |
runs-on: ubuntu-22.04 | |
needs: prepare_release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
set +e | |
docker rmi `docker images -q` | |
[[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" | |
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android 2>/dev/null | |
sudo -E apt-get -y update | |
sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true | |
sudo -E systemctl daemon-reload | |
echo "Deleting files, please wait ..." | |
sudo rm -rf \ | |
/usr/share/dotnet \ | |
/etc/mysql \ | |
/etc/php \ | |
/opt/* | |
sudo -E apt-get -y purge \ | |
azure-cli \ | |
ghc* \ | |
zulu* \ | |
hhvm \ | |
llvm* \ | |
firefox \ | |
google* \ | |
dotnet* \ | |
powershell \ | |
openjdk* \ | |
mysql* \ | |
php* | |
sudo -E apt-get update | |
sudo -E apt-get -y ack binutils bison build-essential \ | |
ccache cmake device-tree-compiler flex gawk gettext \ | |
git gperf intltool libelf-dev libglib2.0-dev \ | |
libgmp3-dev libltdl-dev libncurses5-dev libssl-dev \ | |
libreadline-dev libtool wget nano patch sudo \ | |
pkgconf python3 python3-pyelftools xxd zlib1g-dev \ | |
subversion swig texinfo unzip rsync | |
sudo -E apt-get -y autoremove --purge | |
sudo -E apt-get clean | |
- name: Clone source code | |
env: | |
REPO_URL: https://github.com/AvaotaSBC/openwrt.git | |
REPO_BRANCH: openwrt-23.05 | |
run: | | |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt | |
cd openwrt | |
- name: Update & Install feeds | |
working-directory: ./openwrt | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
- name: Configuration Customization - Build_Openwrt | |
env: | |
CONFIG_FILE: 'default-conf/avaota-a1.config' | |
run: | | |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config | |
cd openwrt && make defconfig | |
- name: Download package | |
working-directory: ./openwrt | |
run: | | |
make download -j$(nproc) | |
find dl -size -1024c -exec ls -l {} \; | |
find dl -size -1024c -exec rm -f {} \; | |
- name: Build firmware | |
working-directory: ./openwrt | |
run: | | |
echo -e "build." | |
make V=s -j$(nproc) | |
- name: Upload | |
if: needs.prepare_release.outputs.release_id != '' | |
uses: xresloader/upload-to-github-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ needs.prepare_release.outputs.release_id }} | |
file: "./openwrt/bin/targets/avaotasbc/t527/*.gz*" | |
draft: false | |
- name: Rollback release | |
if: failure() && needs.prepare_release.outputs.release_id != '' | |
uses: author/action-rollback@stable | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ needs.prepare_release.outputs.release_id }} |