From 6d1c88367fcd016ffc15fb26c866b5f65a47ac9f Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Fri, 8 Apr 2022 18:28:34 +0200 Subject: [PATCH 1/4] Generate version tags for docker images --- .github/workflows/docker-image.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f84d6de..479d930 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,7 +2,13 @@ name: Docker Image CI on: push: - branches: [ main ] + branches: + - 'main' + tags: + - 'v*' + pull_request: + branches: + - 'main' jobs: docker: @@ -11,6 +17,19 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: mrtux/pingboard-daemon + tags: | + # 1.2.3 + type=semver,pattern={{version}} + # disabled if major zero + type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} + # generate lates from default branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -18,6 +37,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub + if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -28,5 +48,6 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - push: true - tags: mrtux/pingboard-daemon:latest + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 9a6739d5fc2ce720022bff4932d9b4e16bf5ca0b Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Fri, 8 Apr 2022 18:44:30 +0200 Subject: [PATCH 2/4] Add action to generate releases --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..44236e4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Create release + +on: + push: + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + name: "🚀 Release" + runs-on: ubuntu-18.04 + steps: + - name: "📥 Check-out" + uses: actions/checkout@v1 + - name: "✏️ Generate release changelog" + id: generate-release-changelog + uses: ./ + with: + token: ${{ secrets.CHANGELOG_TOKEN }} + onlyLastTag: "true" + stripHeaders: "true" + stripGeneratorNotice: "true" + - name: "🚀 Create GitHub release" + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.CHANGELOG_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: ${{ steps.generate-release-changelog.outputs.changelog }} From 97504842540a94e2e6a106e6abe76130bce07afa Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Fri, 8 Apr 2022 18:46:03 +0200 Subject: [PATCH 3/4] Add "Run with Docker" header --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index da3d2dd..3187730 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ PingBoard as an IoT input device and execute actions outside the USB host. ## Usage +### Run with Docker + Deployment via Docker is not trivial, as the daemon needs access to USB (evdev and serial). With the configuration stored in a file `.env`, the daemon can be started as follows: From a9bef84e8add7306985a7162729358c7aac7fb6e Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Fri, 8 Apr 2022 18:50:03 +0200 Subject: [PATCH 4/4] List features in README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3187730..970a332 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ A daemon that connects to a [PingBoard](https://github.com/PingTechGmbH/PingBoar sends key presses and accepts configuration via [RabbitMQ](https://www.rabbitmq.com/). The main goal is to enable the PingBoard as an IoT input device and execute actions outside the USB host. +Features: +* Emits AMQP messages on Pingboard key press. +* Configures Pingboard (Brightness, Key LED colors, Blinking) with AMQP messages. +* Detects PingBoard via evdev and grabs it to prevent rogue inputs to other applications. +* Reconnects when connections to RabbitMQ or Pingboard are lost. Can also be started without Pingboard present. +* Current state is pushed to the configuration queue when finishing, so that it can be retrieved on the next run. +* Runs out of an unprivileged Docker container. + ## Table of Contents - [Usage](#usage)