diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 878229db..f85767d7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,7 +48,7 @@ jobs: - name: Upload VitePress artifact uses: actions/upload-artifact@v4 with: - name: vitepress-site + name: vitepress path: docs/.vitepress/dist # Build job for ESPHome @@ -58,7 +58,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Create Output Directory run: mkdir -p output @@ -66,29 +65,22 @@ jobs: - name: Download github-pages artifact uses: actions/download-artifact@v4 with: - name: vitepress-site + name: vitepress path: output - - name: Set up Python - uses: actions/setup-python@v4 + - name: Compile ESPHome project + uses: esphome/build-action@v3.2.0 + id: esphome-build with: - python-version: 3.x - - - name: Install ESPHome - run: pip install esphome - - - name: Create ESPHome Output Directory - run: mkdir -p output/esphome + yaml_file: firmware/doorman-min.yaml + version: latest - - name: Compile ESPHome project - run: | - ls -la - esphome compile firmware/doorman-min.yaml + - run: | + mkdir output/esphome/ ls -la - - - name: Move ESPHome build to /esphome directory - run: | - mv firmware/.esphome/build/* output/esphome/ + mv "${{ steps.esphome-build.outputs.name}}" temp + mv temp doorman-stock-firmware + mv doorman-stock-firmware output/esphome/ - name: Upload all artifacts as github-pages uses: actions/upload-artifact@v4 diff --git a/.github/workflows/esphome-build.yml b/.github/workflows/esphome-build.yml index aeae05f3..f758e0e4 100644 --- a/.github/workflows/esphome-build.yml +++ b/.github/workflows/esphome-build.yml @@ -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 \ No newline at end of file + 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 \ No newline at end of file