Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/universal-silabs-flasher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Build Universal Silabs Flasher

on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- .github/workflows/universal-silabs-flasher.yml
- images/universal-silabs-flasher/**
pull_request:
branches:
- main
paths:
- .github/workflows/universal-silabs-flasher.yml
- images/universal-silabs-flasher/**

jobs:
build-container:
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
EARTHLY_ORG: marinatedconcrete
EARTHLY_SATELLITE: config-repo
runs-on: "ubuntu-latest"
permissions:
contents: "read"
packages: "write"

steps:
- uses: earthly/actions-setup@v1.0.8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# renovate: datasource=docker depName=earthly/earthly
version: "v0.7.22"
- uses: "actions/checkout@v4.1.1"

- name: "Login to GitHub Container Hub"
run: docker login --username "${{ github.actor }}" --password "${{ secrets.GITHUB_TOKEN }}" ghcr.io

- id: tags
run: echo "TAG=$BRANCH" | tr / _ >> "$GITHUB_ENV"
env:
BRANCH: ${{ github.event_name != 'pull_request' && 'latest' || format('pr-{0}', github.head_ref) }}

- name: "Build Universal Silabs Flasher"
run: earthly ./images/universal-silabs-flasher/+image --TAG=$TAG
env:
EARTHLY_CI: true
EARTHLY_PUSH: true
# Only one platform per https://docs.earthly.dev/docs/earthly-command#build-options
EARTHLY_PLATFORMS: linux/amd64
1 change: 1 addition & 0 deletions images/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ FROM alpine
all:
BUILD ./kairos-ubuntu-22-lts/+image
BUILD ./kairos-zsh-bundle/+image
BUILD ./universal-silabs-flasher/+image
BUILD ./usb-image/+image
15 changes: 15 additions & 0 deletions images/universal-silabs-flasher/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
VERSION 0.7
# renovate: datasource=docker depName=python
ARG PYTHON_VERSION=3.12.0-bullseye
FROM python:$PYTHON_VERSION

image:
COPY requirements.txt .
RUN pip install -r requirements.txt
# Firmware appears to be unversioned in a way that renovate can handle
ARG FIRMWARE_BRANCH='main'
RUN git clone https://github.com/NabuCasa/silabs-firmware.git --branch $FIRMWARE_BRANCH
ARG TAG='latest'
SAVE IMAGE --push ghcr.io/marinatedconcrete/universal-silabs-flasher:$TAG


2 changes: 2 additions & 0 deletions images/universal-silabs-flasher/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
universal-silabs-flasher==0.0.15