Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
add sleep + CI update
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak committed Nov 13, 2020
1 parent 6c12d03 commit a890ec8
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 70 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: docker build

on:
push:
paths-ignore:
- 'README.md'
branches:
- master
pull_request:
branches:
- '*'
schedule:
- cron: '0 7 1 * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build
uses: docker/build-push-action@v2
69 changes: 0 additions & 69 deletions .github/workflows/dockerimage.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: release

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
id: prepare
run: |
git fetch --prune --unshallow --tags
VERSION=$(git tag --points-at HEAD)
VERSION=${VERSION//v}
IMAGE_NAME=${GITHUB_REPOSITORY#*/}
IMAGE_NAME="${{ secrets.DOCKERHUB_USER }}/${IMAGE_NAME//docker-}"
IMAGE_TAGS="${IMAGE_NAME}:latest,${IMAGE_NAME}:${VERSION}"
echo "## :bookmark_tabs: Changes" >>"CHANGELOG.md"
git log --pretty=format:"- %s %H%n" $(git describe --abbrev=0 --tags $(git describe --tags --abbrev=0)^)...$(git describe --tags --abbrev=0) >>"CHANGELOG.md"
echo ::set-output name=image_tags::${IMAGE_TAGS}
echo ::set-output name=version::${VERSION}
echo ::set-output name=changelog::${CHANGELOG}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.prepare.outputs.image_tags }}

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.prepare.outputs.version }}
body_path: CHANGELOG.md
draft: false
prerelease: false
4 changes: 3 additions & 1 deletion lirc_watcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

import socket
import os
import paho.mqtt.client as paho
from threading import Timer
Expand Down Expand Up @@ -116,6 +115,9 @@ def send_code(priority_data=None):
t = Timer(READ_TIMEOUT, send_code)
t.start()

time.sleep(0.01)


except KeyboardInterrupt:
mqtt.disconnect()
mqtt.loop_stop()

0 comments on commit a890ec8

Please sign in to comment.