Use previous device if current device is unknown in 002-error post-tr… #1149
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: openmptcprouter | |
on: [push] | |
env: | |
REPO_URL: 'https://github.com/ysurac/openmptcprouter' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r3, bpi-r4, bpi-r4-poe, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m, z8102ax_64m] | |
OMR_KERNEL: [5.4, 6.6] | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Branch name | |
id: branch_name | |
run: | | |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | |
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
echo "WORKSPACE=${GITHUB_WORKSPACE}" >> $GITHUB_OUTPUT | |
- name: Prepare | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc-s1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler python3-pyelftools llvm clang | |
- if: matrix.OMR_KERNEL == '6.6' | |
name: Install LLVM | |
run: | | |
sudo apt-get install llvm clang | |
- name: Free disk space | |
run: | | |
df -h | |
sudo swapoff -a >/dev/null 2>&1 || true | |
sudo rm -f /swapfile >/dev/null 2>&1 || true | |
sudo apt-get autoremove -y >/dev/null 2>&1 || true | |
sudo apt-get autoclean -y >/dev/null 2>&1 || true | |
sudo rm -rf "/usr/local/share/boost" >/dev/null 2>&1 || true | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" >/dev/null 2>&1 || true | |
sudo rm -rf /usr/share/dotnet >/dev/null 2>&1 || true | |
sudo rm -rf /usr/local/lib/android >/dev/null 2>&1 || true | |
sudo rm -rf /opt/ghc >/dev/null 2>&1 || true | |
sudo docker rmi $(docker images -qf "dangling=true") >/dev/null 2>&1 || true | |
df -h | |
- name: Clone source code | |
working-directory: ../../ | |
env: | |
REPO_URL: https://github.com/ysurac/openmptcprouter | |
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }} | |
run: | | |
git clone $REPO_URL omr | |
if [ "$SOURCE_NAME" != "develop" ]; then | |
cd omr | |
pwd | |
git fetch | |
git checkout master | |
else | |
cd omr | |
git checkout develop | |
fi | |
git pull | |
pwd | |
- name: Build toolchain | |
working-directory: ../../omr | |
env: | |
OMR_FEED_URL: https://github.com/ysurac/openmptcprouter-feeds | |
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
OMR_TARGET: ${{ matrix.OMR_TARGET }} | |
OMR_KERNEL: ${{ matrix.OMR_KERNEL }} | |
OMR_HOST: ${{ secrets.OMR_HOST }} | |
OMR_PORT: ${{ secrets.OMR_PORT }} | |
run: | | |
OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j$(nproc) || OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j1 V=s | |
#echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/$OMR_KERNEL/source/key-build | |
#echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/$OMR_KERNEL/source/key-build.pub | |
- name: Build packages | |
working-directory: ../../omr | |
env: | |
OMR_TARGET: ${{ matrix.OMR_TARGET }} | |
OMR_KERNEL: ${{ matrix.OMR_KERNEL }} | |
run: | | |
make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source package/{compile,install,index} -j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source package/{compile,install,index} -j1 V=s | |
- name: Build image | |
working-directory: ../../omr | |
env: | |
OMR_TARGET: ${{ matrix.OMR_TARGET }} | |
OMR_KERNEL: ${{ matrix.OMR_KERNEL }} | |
run: | | |
make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source target/install -j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source target/install -j1 V=s | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.OMR_TARGET }} | |
path: /home/runner/work/omr/${{ matrix.OMR_TARGET }}/${{ matrix.OMR_KERNEL }}/source/bin | |
overwrite: true | |
- if: steps.branch_name.outputs.SOURCE_BRANCH == '' | |
name: Deploy - Create directory | |
uses: ysurac/ssh-action@master | |
env: | |
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} | |
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} | |
with: | |
command: | | |
mkdir -p deploy/release/${{env.SOURCE_TAG}}/${{matrix.OMR_TARGET}} | |
host: ${{ secrets.OMR_DEPLOY_HOST }} | |
user: deploy | |
port: ${{ secrets.OMR_DEPLOY_PORT }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
args: -tt | |
- if: steps.branch_name.outputs.SOURCE_BRANCH != '' | |
name: Deploy - Create directory | |
uses: ysurac/ssh-action@master | |
env: | |
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} | |
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} | |
with: | |
command: | | |
mkdir -p deploy/${{env.SOURCE_BRANCH}}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}} | |
host: ${{ secrets.OMR_DEPLOY_HOST }} | |
user: deploy | |
port: ${{ secrets.OMR_DEPLOY_PORT }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
args: -tt | |
- name: Move binaries for rsync | |
working-directory: ../../omr | |
env: | |
OMR_TARGET: ${{ matrix.OMR_TARGET }} | |
OMR_KERNEL: ${{ matrix.OMR_KERNEL }} | |
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }} | |
run: | | |
mv ${OMR_TARGET}/${OMR_KERNEL}/source/bin ${GITHUB_WORKSPACE}/ | |
- if: steps.branch_name.outputs.SOURCE_BRANCH == '' | |
name: Deploy - Upload via rsync | |
uses: ysurac/action-rsync@master | |
env: | |
ARGS: -av --delete-after | |
TARGET: deploy/release/${{steps.branch_name.outputs.SOURCE_TAG}}/${{matrix.OMR_TARGET}} | |
SOURCE: ./bin/ | |
KEY: ${{ secrets.PRIVATE_KEY }} | |
USER: deploy | |
HOST: ${{ secrets.OMR_DEPLOY_HOST }} | |
PORT: ${{ secrets.OMR_DEPLOY_PORT }} | |
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} | |
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} | |
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }} | |
- if: steps.branch_name.outputs.SOURCE_BRANCH != '' | |
name: Deploy - Upload via rsync | |
uses: ysurac/action-rsync@master | |
env: | |
ARGS: -av --delete-after | |
TARGET: deploy/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}} | |
SOURCE: ./bin/ | |
KEY: ${{ secrets.PRIVATE_KEY }} | |
USER: deploy | |
HOST: ${{ secrets.OMR_DEPLOY_HOST }} | |
PORT: ${{ secrets.OMR_DEPLOY_PORT }} | |
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} | |
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} | |
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }} | |