Skip to content

Update to Z-Wave JS v15.18.0 #296

Update to Z-Wave JS v15.18.0

Update to Z-Wave JS v15.18.0 #296

Workflow file for this run

name: Build and Release Images
on:
push:
branches:
- main
paths:
- .arg
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
build-target:
description: Build Target
required: false
default: "+test"
type: choice
options:
- "+test"
- "+all"
zwave-js-version:
description: Z-Wave JS version
required: false
default: "latest"
zwave-js-server-version:
description: Z-Wave JS Server version
required: false
default: "latest"
npm-install-flags:
description: Extra `npm install` flags
required: false
type: string
push:
description: Push image to registries
required: true
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Install earthly
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Login to Docker Hub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set workflow dispatch environment
if: github.event_name == 'workflow_dispatch'
run: |
zjsver=${{ github.event.inputs.zwave-js-version }}
zjssver=${{ github.event.inputs.zwave-js-server-version }}
npmflags=${{ github.event.inputs.npm-install-flags }}
printf 'EARTHLY_BUILD_ARGS=ZWAVE_JS_VERSION=%s,ZWAVE_JS_SERVER_VERSION=%s,NPM_INSTALL_EXTRA_FLAGS=%s\n' "${zjsver}" "${zjssver}" "${npmflags}" >> "${GITHUB_ENV}"
printf 'target=%s\n' "${{ github.event.inputs.build-target }}" >> "${GITHUB_ENV}"
- name: Set PR environment
if: github.event_name == 'pull_request'
run: |
printf 'target=+test\n' >> $GITHUB_ENV
- name: Set release environment
if: github.event_name == 'push'
run: |
printf 'target=+all\n' >> $GITHUB_ENV
- name: Build Images
run: earthly --ci ${{ env.target }}
- name: Push to Docker Hub
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true')
run: earthly --ci --push ${{ env.target }}
- name: Push to GitHub Container Registry
if: github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true')
run: earthly --ci --push ${{ env.target }} --REGISTRY=ghcr.io