From 8b288380ce57c8200759137990f0d3e8b2d6db5e Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 20 Apr 2024 14:42:58 +0200 Subject: [PATCH] Use pre-built images (#9) --- .github/workflows/build.yaml | 47 ++++++++++++++++++++++++++++++++++++ snmpd/CHANGELOG.md | 3 +++ snmpd/config.yaml | 3 ++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..2e4f643 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,47 @@ +name: Build add-on + +on: + pull_request: + branches: ["main"] + push: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + name: Build ${{ matrix.arch }} snmpd add-on + strategy: + matrix: + arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] + + steps: + - name: Check out repository + uses: actions/checkout@v4.1.2 + + - name: Get information + id: info + uses: home-assistant/actions/helpers/info@master + with: + path: "./snmpd" + + - name: Set build arguments + run: | + if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then + echo "BUILD_ARGS=--docker-hub-check" >> $GITHUB_ENV; + fi + + - name: Login to DockerHub + if: env.BUILD_ARGS == '--docker-hub-check' + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build snmpd add-on + uses: home-assistant/builder@2024.03.5 + with: + args: | + ${{ env.BUILD_ARGS }} \ + --${{ matrix.arch }} \ + --target /data/snmpd \ + --addon diff --git a/snmpd/CHANGELOG.md b/snmpd/CHANGELOG.md index 91ac4bf..32aa0ff 100644 --- a/snmpd/CHANGELOG.md +++ b/snmpd/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.3.0 +- use pre-built images + ## 0.2.3 - add VScode dev container - fix supervisor api permission denied error diff --git a/snmpd/config.yaml b/snmpd/config.yaml index ade7262..7325676 100644 --- a/snmpd/config.yaml +++ b/snmpd/config.yaml @@ -1,5 +1,5 @@ name: "SNMPD" -version: "0.2.3" +version: "0.3.0" slug: "snmpd" description: "Monitor your HA installation via snmp" url: "https://github.com/mib1185/ha-addon-snmpd" @@ -9,6 +9,7 @@ arch: - armhf - armv7 - i386 +image: mib85/{arch}-ha-addon-snmpd init: false startup: services host_network: true