-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- pin esphome version based on requirements.txt - add project_version to manifest.json - bump actions/[email protected] - bump actions/[email protected]
- Loading branch information
Showing
3 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,15 @@ jobs: | |
- uses: actions/[email protected] | ||
- name: Mock secrets.yaml from example | ||
run: cp secrets.yaml.example secrets.yaml | ||
- name: Get ESPHome version | ||
id: get_esphome_version | ||
# read esphome version from requirements.txt | ||
run: | | ||
esphome_version=$(grep esphome requirements.txt | cut -d'=' -f3) | ||
echo "esphome_version=$esphome_version" >> "$GITHUB_OUTPUT" | ||
- name: Build ESPHome firmware to verify configuration | ||
uses: esphome/[email protected] | ||
with: | ||
yaml_file: ${{ matrix.file }} | ||
cache: true | ||
version: ${{ steps.get_esphome_version.outputs.esphome_version }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,6 @@ on: | |
required: false | ||
type: string | ||
default: manifest.json | ||
esphome_version: | ||
description: Version of ESPHome to build for. | ||
required: false | ||
type: string | ||
default: latest | ||
|
||
jobs: | ||
prepare: | ||
|
@@ -53,34 +48,45 @@ jobs: | |
- uses: actions/[email protected] | ||
- name: Mock secrets.yaml from example | ||
run: cp secrets.yaml.example secrets.yaml | ||
- name: Get ESPHome version | ||
id: get_esphome_version | ||
# read esphome version from requirements.txt | ||
run: | | ||
esphome_version=$(grep esphome requirements.txt | cut -d'=' -f3) | ||
echo "esphome_version=$esphome_version" >> "$GITHUB_OUTPUT" | ||
- uses: esphome/[email protected] | ||
id: esphome-build | ||
with: | ||
cache: false | ||
cache: true | ||
yaml_file: ${{ matrix.file }} | ||
version: ${{ inputs.esphome_version }} | ||
- run: | | ||
version: ${{ steps.get_esphome_version.outputs.esphome_version }} | ||
- name: Move generated files to output | ||
run: | | ||
mkdir output | ||
mv "${{ steps.esphome-build.outputs.name }}" output/ | ||
- uses: actions/[email protected] | ||
echo ${{ steps.esphome-build.outputs.version }} > output/version | ||
echo ${{ steps.esphome-build.outputs.project-version }} > output/project_version | ||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ inputs.name }} | ||
name: build-${{ matrix.file }} | ||
path: output | ||
retention-days: 1 | ||
|
||
publish: | ||
name: Publish new firmware and website to GitHub Pages | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/download-artifact@v3.0.2 | ||
- uses: actions/download-artifact@v4.1.7 | ||
with: | ||
pattern: build-* | ||
merge-multiple: true | ||
path: output | ||
name: ${{ inputs.name }} | ||
|
||
- name: Create single manifest.json | ||
run: | | ||
jq -s '{"name": "${{ inputs.name }}", "version": "${{ needs.build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/*/manifest.json > output/${{ inputs.manifest_filename }} | ||
version=$(cat output/project_version) | ||
jq --arg version "$version" '{"name": "${{ inputs.name }}", "version": $version, "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/*/manifest.json > output/${{ inputs.manifest_filename }} | ||
- run: cp -R static/* output | ||
|
||
|
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