Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Aug 11, 2024
1 parent daf5ddb commit bd0fa8d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 46 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,33 @@ jobs:
name: vitepress
path: docs/.vitepress/dist

# Build job for ESPHome
build-esphome:
build-doorman-stock-firmware:
name: Build Doorman Stock Firmware
uses: ./.github/workflows/esphome-build.yml
with:
files: firmware/doorman-min.yaml
name: Doorman Stock
manifest_filename: doorman-stock-manifest.json
clean: false
esphome_version: latest
directory_name: doorman-stock

build-doorman-nuki-bridge-firmware:
name: Build Doorman Nuki Bridge Firmware
uses: ./.github/workflows/esphome-build.yml
with:
files: firmware/doorman-min.yaml
name: Doorman Nuki Bridge
manifest_filename: doorman-nuki-bridge-manifest.json
clean: false
esphome_version: latest
directory_name: doorman-nuki-bridge


# Bundle all assets for Pages
bundle-assets:
runs-on: ubuntu-latest
needs: build-docs
needs: [build-docs, build-doorman-stock-firmware, build-doorman-nuki-bridge-firmware]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -68,27 +91,6 @@ jobs:
name: vitepress
path: output

- name: Compile ESPHome project
uses: esphome/build-action@v3.2.0
id: esphome-build
with:
yaml_file: firmware/doorman-min.yaml
version: latest

- name: Copy files to output directory
run: |
mkdir output/firmware-builds/
mv "${{ steps.esphome-build.outputs.name }}" temp
mv temp doorman-stock-firmware
mv doorman-stock-firmware output/firmware-builds/
ls output/firmware-builds
ls output/firmware-builds/doorman-stock-firmware
- name: Create single manifest.json
run: |
jq -s '{"name": "doorman-stock-firmware", "version": "${{ steps.esphome-build.outputs.project-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/firmware-builds/*/manifest.json > output/firmware-builds/doorman-stock-firmware-manifest.json
sed -i 's/${{ steps.esphome-build.outputs.esphome-build-name }}\//doorman-stock-firmware\//g' output/firmware-builds/doorman-stock-firmware-manifest.json
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
Expand All @@ -99,7 +101,7 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [build-docs, build-esphome]
needs: [bundle-assets]
runs-on: ubuntu-latest
name: Deploy
steps:
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/esphome-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,24 @@ jobs:
name: ${{ inputs.name }}
path: output

#publish:
# if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/docs-test')
# name: Publish new firmware
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - uses: actions/checkout@v3.5.3
# - uses: actions/download-artifact@v3.0.2
# with:
# path: output
# name: ${{ inputs.name }}
#
# - name: Create single manifest.json
# run: |
# jq -s '{"name": "${{ inputs.name }}", "version": "${{ needs.build.outputs.project-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/*/manifest.json > output/${{ inputs.manifest_filename }}
# sed -i 's/${{ needs.build.outputs.esphome-build-name }}\//${{ inputs.directory_name }}\//g' output/${{ inputs.manifest_filename }}
#
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ inputs.name }}
# path: output
publish:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/docs-test')
name: Publish new firmware
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/download-artifact@v3.0.2
with:
path: output
name: ${{ inputs.name }}

- name: Create single manifest.json
run: |
jq -s '{"name": "${{ inputs.name }}", "version": "${{ needs.build.outputs.project-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/*/manifest.json > output/${{ inputs.manifest_filename }}
sed -i 's/${{ needs.build.outputs.esphome-build-name }}\//${{ inputs.directory_name }}\//g' output/${{ inputs.manifest_filename }}
- uses: actions/upload-artifact@v4
with:
name: firmware-${{ inputs.name }}
path: output

0 comments on commit bd0fa8d

Please sign in to comment.