esphome / build-action

Apache License 2.0
14 stars 11 forks source link

[Feature] Support build parameters #58

Open spuder opened 3 days ago

spuder commented 3 days ago

As a user who builds esphome using build parameters. I need the ability to provide those build parameters to the GitHub actions.

Example

Production boards are built using different pin assignments than the development boards.

    esphome \
        -s name foobar \
        -s rfid1_miso_pin "GPIO37" \
        -s rfid1_clk_pin "GPIO36" \
        -s rfid1_mosi_pin "GPIO35" \
        -s rfid1_ss_pin "GPIO34" \
        -s rfid1_spi_interface "spi2" \
        compile config.yaml

Desired outcome

      - name: Build ESPHome firmware
        uses: esphome/build-action@v4.0.2
        with:
          yaml-file: firmware/config.yaml
          complete-manifest: true
          build_parameters: # <------- add build parameters
            - name: foobar
            - rfid1_miso_pin: GPIO37
            - rfid1_clk_pin: GPIO36
            - rfid1_mosi_pin: GPIO35
            - rfid1_ss_pin: GPIO34
spuder commented 2 days ago

Additional use case example


substitutions:
  version: "0.1.0"

esphome:
  name: living_room_sensor
  min_version: "2023.11.0"
  project:
    name: "your_name.living_room_project"
    version: ${version}

Where $version is provided automatically on a git tag or release