build_ha_edge #270
This file contains 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 HA addon edge | |
on: | |
repository_dispatch: | |
types: [build_ha_edge] | |
concurrency: | |
group: ha-addon-build-edge | |
cancel-in-progress: true | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
token: '${{ secrets.HA_PAT }}' | |
- name: Update README and set version in config.json | |
run: | | |
sed -i "s|\s\{4,\}\"version\".*| \"version\": \"${{ github.event.client_payload.ver }}\"\,|g" wmbusmeters-ha-addon-edge/config.json | |
sed -i "1s|^|## ${{ github.event.client_payload.ver }} \n- Updated to version [${{ github.event.client_payload.ver }}](https://github.com/wmbusmeters/wmbusmeters/commits/master)\n|" wmbusmeters-ha-addon-edge/CHANGELOG.md | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ha-addon_artifact-${{ github.event.client_payload.ver }} | |
path: ${{ github.workspace }} | |
retention-days: 1 | |
build: | |
needs: prepare | |
runs-on: ubuntu-latest | |
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on | |
strategy: | |
matrix: | |
addon: ["wmbusmeters"] | |
arch: ["amd64", "armv7", "aarch64"] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ha-addon_artifact-${{ github.event.client_payload.ver }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PAT }} | |
- name: Build ${{ matrix.addon }} ${{ matrix.arch }} HA add-on | |
uses: home-assistant/builder@master | |
with: | |
args: | | |
--${{ matrix.arch }} \ | |
--target wmbusmeters-ha-addon-edge \ | |
--version ${{ github.event.client_payload.ver }} | |
update-repo: | |
needs: [prepare, build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
token: '${{ secrets.HA_PAT }}' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ha-addon_artifact-${{ github.event.client_payload.ver }} | |
- name: Push changed files back to repo | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: "Auto Push - update ha-addon config and changelog for ${{ github.event.client_payload.ver }} - [no ci]" |