Skip to content

Build and deploy esp82xx-nonos-linklayer #8

Build and deploy esp82xx-nonos-linklayer

Build and deploy esp82xx-nonos-linklayer #8

name: Build and deploy esp82xx-nonos-linklayer
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
environment: deploy
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/cache@v4
with:
path: |
esp8266/tools/dist
esp8266/tools/sdk/lwip2/builder/lwip2-src
key: ${{ runner.os }}-deploy-${{ hashFiles('esp8266/tools/sdk/lwip2/builder/patches/*.patch', 'esp8266/tools/sdk/lwip2/builder/makefiles/Makefile.defs', 'esp8266/package/package_esp8266com_index.template.json') }}
- name: Fetch ESP8266 Core
uses: actions/checkout@v4
with:
path: esp8266
repository: esp8266/Arduino
fetch-depth: 1
submodules: false
- name: Initialize deploy tools
run: |
mkdir ${HOME}/.ssh
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ${HOME}/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
echo -ne "Host github.com\n\tHostname github.com\n\tIdentityFile ~/.ssh/deploy_key\n" > \
${HOME}/.ssh/config
pushd esp8266
git config user.name "Maxim Prokhorov (CI)"
git config user.email "[email protected]"
popd
- name: Initialize build environment
run: |
pushd esp8266/tools
python get.py -q
popd
- name: Prepare lwip2 builder
run: |
pushd esp8266
git remote add deploy [email protected]:${{ github.repository }}.git
git switch -c lwip2-rebuild
git submodule update --init -- tools/sdk/lwip2/builder
git submodule update --remote --merge -- tools/sdk/lwip2/builder
git add -u
git commit -m 'Update lwip2 builder'
popd
- name: Build and deploy
run: |
pushd esp8266
pushd tools/sdk/lwip2
make install
popd
git add -u
git commit -m 'Rebuild lwip2 libs'
branch=$(date -Im | tr '[:punct:]' '_')
git push deploy lwip2-rebuild:lwip2/build-${branch}
popd