Skip to content

Commit

Permalink
Move ESPHome project version action
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Aug 14, 2024
1 parent 185207e commit e3acde1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/deploy-pages-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,12 @@ jobs:

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Extract version from base.yaml
id: extract_version
run: |
VERSION=$(awk '/project:/, /version:/' firmware/base.yaml | grep 'version:' | awk '{print $2}' | sed 's/[",]//g')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Update ESPHome project version
run: |
sed -i '/^ project:/,/^ platformio_options:/s/^ version: .*/ version: "'"$VERSION"'-dev"/' firmware/base.yaml
- name: Update package.json version
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"${VERSION}-dev\"/" package.json
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
uses: actions/configure-pages@v4

- name: Extract version from base.yaml
id: extract_version
run: |
VERSION=$(awk '/project:/, /version:/' firmware/base.yaml | grep 'version:' | awk '{print $2}' | sed 's/[",]//g')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/esphome-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Update ESPHome project version
if: github.ref != 'refs/heads/master'
run: |
sed -i '/^ project:/,/^ platformio_options:/s/^ version: .*/ version: "'"$VERSION"'-dev"/' firmware/base.yaml
- uses: esphome/build-action@v4.0.1
id: esphome-build
with:
Expand Down

0 comments on commit e3acde1

Please sign in to comment.