-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Debug artifact files * Test again * Refactor build workflow and display file structure * Refactor build folder structure and manifest generation * Update build-firmware.yaml to include multiple firmware options * Test again * Copy firmware files to build assets * Update firmware file location * Fix file removal in build workflow * Last round up to finish the build
- Loading branch information
1 parent
848b78a
commit 490478e
Showing
1 changed file
with
26 additions
and
16 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 |
---|---|---|
|
@@ -23,7 +23,8 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
env: | ||
FIRMWARES: home-assistant-glow | ||
FIRMWARES: | | ||
home-assistant-glow | ||
jobs: | ||
prepare: | ||
|
@@ -97,10 +98,10 @@ jobs: | |
- name: 🔨 Alter path in manifest.json | ||
run: | | ||
sed -i 's/${{ steps.esphome-build.outputs.name }}\//\/${{ matrix.firmware }}\/${{ matrix.device }}\//g' output/${{ matrix.device }}/manifest.json | ||
- name: ⬆️ Upload firmware artifact | ||
- name: ⬆️ Upload firmware / device artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ matrix.firmware}} | ||
name: ${{ matrix.firmware}}-${{ matrix.device }} | ||
path: output | ||
|
||
combined-manifests: | ||
|
@@ -115,20 +116,23 @@ jobs: | |
- project: home-assistant-glow | ||
name: Home Assistant Glow | ||
steps: | ||
- name: ⤵️ Download artifacts | ||
uses: actions/download-artifact@v3.0.2 | ||
- name: ⤵️ Download specific artifacts | ||
uses: actions/download-artifact@v4.1.1 | ||
with: | ||
name: ${{ matrix.project }} | ||
path: files | ||
pattern: ${{ matrix.project }}-* | ||
merge-multiple: true | ||
path: project-build | ||
- name: 🔨 Generate device manifest.json | ||
run: | | ||
version=$(cat files/*/version | sort -V | tail -n 1) | ||
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' files/*/manifest.json > manifest.json | ||
- name: ⬆️ Upload manifest.json | ||
version=$(cat project-build/*/version | sort -V | tail -n 1) | ||
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' project-build/*/manifest.json > project-build/manifest.json | ||
- name: 🧪 Display structure of job | ||
run: ls -R | ||
- name: ⬆️ Upload project artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ matrix.project }} | ||
path: manifest.json | ||
path: project-build | ||
|
||
build-docs: | ||
name: Build documentation website | ||
|
@@ -138,12 +142,18 @@ jobs: | |
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: ⬇️ Download artifacts | ||
uses: actions/download-artifact@v3.0.2 | ||
- name: ⬇️ Download all artifacts | ||
uses: actions/download-artifact@v4.1.1 | ||
with: | ||
path: output | ||
- name: 🗂️ Copy firmware files to build assets | ||
run: cp -R output/* docs/static | ||
path: repository | ||
- name: 🗂️ Move firmware folders to static | ||
run: | | ||
for firmware in $FIRMWARES; do | ||
mv repository/$firmware docs/static | ||
done | ||
rm -R repository | ||
- name: 🧪 Display structure of job | ||
run: ls -R | ||
|
||
- name: 🏗️ Set up Node.js | ||
uses: actions/[email protected] | ||
|