Update build_script.yml #13
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 and Patch MicroPython | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-micropython: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Intialize Submodules | |
run: git submodule update --init lib/micropython src/obo-car | |
- name: Install libraries | |
run: | | |
pushd lib/micropython | |
git submodule update --init lib/berkeley-db-1.xx lib/micropython-lib | |
popd | |
- name: Get Version Tag | |
id: version_tag | |
run: echo "tag=v$(date +'%Y.%m.%d')-build-${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT | |
- name: Building mpy-cross | |
run: make -C lib/micropython/mpy-cross | |
- name: Run patch script | |
run: python3 patch.py | |
- name: esp-idf build | |
uses: espressif/esp-idf-ci-action@v1 | |
with: | |
esp_idf_version: v5.2.3 | |
target: esp32 | |
path: 'boards/OBO_CAR' | |
command: 'idf.py set-target esp32 && idf.py build' | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: micropython | |
path: boards/OBO_CAR/build/micropython.bin | |
- name: Create release | |
id: create-new-obo-car-image-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.version_tag.outputs.tag }} | |
run: | | |
gh release create "${{ steps.version_tag.outputs.tag }}" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="Obo Car Micropython - ${{ steps.version_tag.outputs.tag }}" \ | |
--generate-notes | |
- name: Upload Binary to Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload "${{steps.version_tag.outputs.tag }}" \ | |
boards/OBO_CAR/build/micropython.bin | |