Skip to content

Commit

Permalink
Merge pull request #187 from huizebruin/dev
Browse files Browse the repository at this point in the history
get version from esphome S0tool code
  • Loading branch information
huizebruin authored Jun 29, 2024
2 parents 607cae7 + b1dfd74 commit 5e4c086
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
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

0 comments on commit 5e4c086

Please sign in to comment.