add docker build and github action

This commit is contained in:
Victor Talpaert
2026-04-05 23:26:11 +02:00
parent 0695f6d851
commit 32475fd207
4 changed files with 95 additions and 0 deletions

42
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Release Firmware
on:
push:
branches: [main]
tags: ['*']
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build firmware
run: docker build -t esp-scope-firmware .
- name: Extract binary
run: docker run --rm esp-scope-firmware cat /workspace/build/esp-scope.bin > esp-scope.bin
- name: Set release tag
id: tag
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
echo "prerelease=false" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
echo "prerelease=true" >> "$GITHUB_OUTPUT"
fi
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
prerelease: ${{ steps.tag.outputs.prerelease }}
files: esp-scope.bin