Skip to content

Upgrade build to Z-Wave JS 12.9.0 #195

Upgrade build to Z-Wave JS 12.9.0

Upgrade build to Z-Wave JS 12.9.0 #195

Workflow file for this run

name: Build and Release Images
on:
push:
branches:
- main
paths:
- .arg
workflow_dispatch:
inputs:
build-target:
description: Build Target
required: true
default: "+test"
type: choice
options:
- "+test"
- "+all"
zwave-js-version:
description: Z-Wave JS version
required: true
zwave-js-server-version:
description: Z-Wave JS Server version
required: true
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@v1.0.9
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
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 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 == 'workflow_dispatch' && github.event.inputs.push == 'true')
run: earthly --ci --push ${{ env.target }} --REGISTRY=ghcr.io