Build and Publish ESPHome firmware #43
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 Publish ESPHome firmware | |
on: | |
workflow_dispatch: | |
inputs: | |
file: | |
description: yaml file name | |
required: true | |
type: string | |
name: | |
description: Name of the firmware to publish. | |
required: false | |
type: string | |
default: ESPHome | |
esphome_version: | |
description: Version of ESPHome to build for. | |
required: false | |
type: string | |
default: latest | |
wifi_ssid: | |
description: Wifi ssid. | |
required: false | |
type: string | |
default: InfoQ | |
wifi_passwd: | |
description: Wifi password. | |
required: false | |
type: string | |
default: "12345678" | |
jobs: | |
build: | |
name: Build ESPHome binary | |
runs-on: ubuntu-latest | |
outputs: | |
esphome-version: ${{ steps.esphome-build.outputs.esphome-version }} | |
steps: | |
- uses: actions/[email protected] | |
- name: setting wifi passwd | |
env: | |
WIFI_SSID: ${{ inputs.wifi_ssid }} | |
WIFI_PASSWD: ${{ inputs.wifi_passwd }} | |
run: sed "s/WIFI_SSID/$WIFI_SSID/g;s/WIFI_PASSWD/$WIFI_PASSWD/g" secrets.yaml.example > secrets.yaml | |
- name: show secrets.yaml | |
run: cat secrets.yaml | |
- uses: esphome/[email protected] | |
id: esphome-build | |
with: | |
yaml_file: ${{ inputs.file }} | |
version: ${{ inputs.esphome_version }} | |
- run: | | |
mkdir output | |
mv "${{ steps.esphome-build.outputs.name }}" output/ | |
- uses: actions/[email protected] | |
with: | |
name: ${{ inputs.name }} | |
path: output |