Skip to content

Create new rtl_433 addon release #724

Create new rtl_433 addon release

Create new rtl_433 addon release #724

Workflow file for this run

# This is nearly identical to the builds on PRs, but doesn't specify
# `--version` to builder so each addon gets it's own version.
name: Create new rtl_433 addon release
on:
push:
branches:
- next
tags:
- '2*'
schedule:
# A random daily time, as Actions doesn't have a suggestion for running
# daily without causing job spikes.
- cron: '16 8 * * *'
env:
REGISTRY: ghcr.io
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build_rtl_433:
name: Build rtl_433 addon
runs-on: ubuntu-latest
strategy:
matrix:
arch: [armhf, armv7, aarch64, amd64, i386]
addon: [rtl_433, rtl_433-next, rtl_433_mqtt_autodiscovery, rtl_433_mqtt_autodiscovery-next]
steps:
- name: Checkout the repository
if: github.event_name != 'schedule'
uses: actions/checkout@v2
- name: Checkout the next branch
if: github.event_name == 'schedule'
uses: actions/checkout@v2
with:
ref: next
- name: Make sure tag doesn't exist
if: github.event_name != 'schedule'
run: |
set -e
sudo apt-get update
sudo apt-get install -y jq
set -x
TAG=$(jq '.version' < rtl_433/config.json)
! docker manifest inspect ghcr.io/${{ github.repository}}-${{ matrix.addon }}-{arch}:$TAG > /dev/null
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Copy files for next if needed
run: |
if [ "${{ matrix.addon }}" == "rtl_433-next" ]; then
cp -nv -R rtl_433/* ${{ matrix.addon }}/
fi
if [ "${{ matrix.addon }}" == "rtl_433_mqtt_autodiscovery-next" ]; then
cp -nv -R rtl_433_mqtt_autodiscovery/* ${{ matrix.addon }}/
fi
- name: Build ${{ matrix.addon }} ${{ matrix.arch }} image
uses: home-assistant/builder@master
if: github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'schedule'
with:
args: |
--${{ matrix.arch }} \
--docker-hub $REGISTRY \
--image ${{ github.repository}}-${{ matrix.addon }}-{arch} \
--no-latest \
--target ${{ matrix.addon }}
- name: Build nightly ${{ matrix.addon }} ${{ matrix.arch }} image
uses: home-assistant/builder@master
if: github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'schedule'
with:
args: |
--${{ matrix.arch }} \
--docker-hub $REGISTRY \
--image ${{ github.repository}}-${{ matrix.addon }}-{arch} \
--no-latest \
--version next \
--target ${{ matrix.addon }}