Skip to content

Commit

Permalink
Pre-build with any dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardtfn committed Nov 4, 2024
1 parent 0cb8bb0 commit c4e11fc
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/validate_esphome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,30 @@ jobs:
name: Prebuilt Firmware
runs-on: ubuntu-latest
needs: code_scan
if: github.ref == 'refs/heads/dev' || github.base_ref == 'dev'
if: contains(github.ref, 'dev') || contains(github.base_ref, 'dev')
steps:
- uses: actions/checkout@main

- name: Read NSPanel ESPHome version
uses: CumulusDS/get-yaml-paths-action@master
id: read_nspanel_esphome_version
with:
file: esphome/nspanel_esphome_version.yaml
version: substitutions.version

- name: Display NSPanel ESPHome version
- name: Extract Version Number
id: extract_version
run: |
VERSION=$(yq eval '.substitutions.version' esphome/nspanel_esphome_core_versioning.yaml)
if [ -z "$VERSION" ]; then
echo "Error: No version found in esphome/nspanel_esphome_core_versioning.yaml"
exit 1
fi
echo "Extracted Version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Debug Version Output
run: |
echo NSPanel ESPHome version: ${{ steps.read_nspanel_esphome_version.outputs.version }}
echo "Version from setup_dependencies: ${{ steps.extract_version.outputs.version }}"
echo "Environment Variable VERSION: $VERSION"
if [ -z "${{ steps.extract_version.outputs.version }}" ]; then
echo "Error: Version output is empty. Exiting..."
exit 1
fi
- name: Build ESPHome Prebuilt Firmware
id: build_nspanel_fw
Expand All @@ -388,7 +398,7 @@ jobs:
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: version
value: ${{ steps.read_nspanel_esphome_version.outputs.version }}
value: ${{ steps.extract_version.outputs.version }}

- name: Update manifest.json - builds.chipFamily
uses: jossef/action-set-json-field@v2.2
Expand All @@ -409,7 +419,7 @@ jobs:
with:
file: ${{ steps.build_nspanel_fw.outputs.name }}/manifest.json
field: builds.ota.release_url
value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.read_nspanel_esphome_version.outputs.version }}"
value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.extract_version.outputs.version }}"

- name: Move and Rename Firmware File - nspanel_esphome_prebuilt
run: |
Expand Down Expand Up @@ -437,7 +447,7 @@ jobs:
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: version
value: ${{ steps.read_nspanel_esphome_version.outputs.version }}
value: ${{ steps.extract_version.outputs.version }}

- name: Update manifest.json - builds.chipFamily
uses: jossef/action-set-json-field@v2.2
Expand All @@ -458,7 +468,7 @@ jobs:
with:
file: ${{ steps.build_wall_display_fw.outputs.name }}/manifest.json
field: builds.ota.release_url
value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.read_nspanel_esphome_version.outputs.version }}"
value: "https://github.com/Blackymas/NSPanel_HA_Blueprint/releases/tag/v${{ steps.extract_version.outputs.version }}"

- name: Move and Rename Firmware File - wall_display
run: |
Expand Down

0 comments on commit c4e11fc

Please sign in to comment.