Merge pull request #48 from andrewjswan/dependabot/github_actions/act… #94
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags-ignore: | |
| - '**' | |
| workflow_call: | |
| inputs: | |
| release-summary: | |
| description: Summary of the release | |
| required: false | |
| type: string | |
| default: "" | |
| release-url: | |
| description: URL to the release notes | |
| required: false | |
| type: string | |
| default: "" | |
| release-version: | |
| description: Version of the release | |
| required: false | |
| type: string | |
| default: "" | |
| workflow_dispatch: | |
| jobs: | |
| configuration: | |
| name: Build configuration list | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Get PixelClock Matrix | |
| id: set-matrix | |
| run: echo "matrix=$(ls *.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| build: | |
| name: Build ${{ matrix.config-file }} | |
| needs: | |
| - configuration | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| config-file: ${{ fromJson(needs.configuration.outputs.matrix) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Build firmware | |
| uses: esphome/build-action@v7 | |
| id: esphome-build | |
| with: | |
| yaml-file: ${{ matrix.config-file }} | |
| version: latest | |
| complete-manifest: true | |
| release-summary: ${{ inputs.release-summary }} | |
| release-url: ${{ inputs.release-url }} | |
| - name: Move files for versioning | |
| run: | | |
| mkdir -p output | |
| mv ${{ steps.esphome-build.outputs.name }}/* output/ | |
| - name: Rename manifest | |
| run: | | |
| mv manifest.json ${{ steps.esphome-build.outputs.original-name }}-manifest.json | |
| working-directory: output | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ format('PixelClock-{0}', steps.esphome-build.outputs.name) }} | |
| path: output | |
| ci-status: | |
| name: Status | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| if: always() | |
| steps: | |
| - name: Success | |
| if: ${{ !(contains(needs.*.result, 'failure')) }} | |
| run: exit 0 | |
| - name: Failure | |
| if: ${{ contains(needs.*.result, 'failure') }} | |
| run: exit 1 |