-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from huizebruin/dev
get version from esphome S0tool code
- Loading branch information
Showing
2 changed files
with
15 additions
and
8 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
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 |
---|---|---|
|
@@ -55,29 +55,36 @@ jobs: | |
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Read version from YAML file | ||
id: read_version | ||
run: | | ||
version=$(grep 'project_version:' esphome/components/basis.yaml | awk '{print $2}' | tr -d '"') | ||
echo "project_version=$version" >> $GITHUB_ENV | ||
- name: Build firmware | ||
uses: esphome/[email protected] | ||
id: esphome-build | ||
with: | ||
yaml_file: ${{ matrix.firmware.file }} | ||
version: latest | ||
release_url: ${{ github.event.release.html_url || env.RELEASE_URL }} | ||
- name: Copy firmware and manifest | ||
|
||
- name: Copy firmware and manifest 🔨 | ||
run: | | ||
mkdir output | ||
mv ${{ steps.esphome-build.outputs.name }} output/ | ||
jq -s '{"name": "${{ matrix.firmware.name }}", "version": "3.6.1", "home_assistant_domain": "esphome", "new_install_prompt_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }} | ||
jq -s "{\"name\": \"${{ matrix.firmware.name }}\", \"version\": \"${{ env.project_version }}\", \"home_assistant_domain\": \"esphome\", \"new_install_prompt_erase\": false, \"builds\":.}" output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }} | ||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ matrix.firmware.name }} | ||
path: output | ||
|
||
|
||
consolidate: | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | ||
name: Consolidate firmwares | ||
name: Consolidate firmwares 🚀 | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
|
@@ -87,7 +94,7 @@ jobs: | |
uses: actions/download-artifact@v4 | ||
with: | ||
path: firmwares | ||
- name: Copy files | ||
- name: Copy files | ||
run: |- | ||
mkdir output | ||
cp -R static/* output/ | ||
|
@@ -99,7 +106,7 @@ jobs: | |
|
||
deploy: | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | ||
name: Deploy to GitHub Pages | ||
name: Deploy to GitHub Pages 🚀 | ||
runs-on: ubuntu-latest | ||
needs: consolidate | ||
permissions: | ||
|
@@ -113,4 +120,4 @@ jobs: | |
uses: actions/configure-pages@v5 | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/[email protected] | ||
uses: actions/[email protected] |