Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get version from esphome S0tool code #187

Merged
merged 2 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ categories:
labels:
- "documentation"
- title: "⬆️ Dependency updates"
collapse-after: 5
collapse-after: 6
labels:
- "dependencies"

Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/build-action@v3.1.0
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/upload-artifact@v4.3.3
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:
Expand All @@ -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/
Expand All @@ -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:
Expand All @@ -113,4 +120,4 @@ jobs:
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5
uses: actions/deploy-pages@v4.0.5