43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
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
|