64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
jobs:
|
|
build:
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
PLATFORMIO_BUILD_CACHE_DIR: ~/.platformio/.build_cache
|
|
PLATFORMIO_CACHE_DIR: ~/.platformio/.cachedir
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
container: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
- name: Cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/pip
|
|
~/.platformio/.cache
|
|
~/.platformio/.build_cache
|
|
~/.platformio/.cachedir
|
|
key: ${{ runner.os }}-pio
|
|
- name: Set up python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.14.0"
|
|
architecture: "x64"
|
|
- name: Install PlatformIO
|
|
run: python3 -m pip install platformio==6.1.18
|
|
- name: Build firmwares
|
|
run: FIRMWARE_VERSION=${{gitea.ref_name}} platformio run
|
|
- name: Archive
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: firmware
|
|
path: .pio/build/*/firmware_*.bin
|
|
retention-days: 1
|
|
release:
|
|
name: Release
|
|
# if: startsWith(github.event.ref, 'refs/tags/v')
|
|
needs: build
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
container: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout repo for CHANGELOG
|
|
uses: actions/checkout@v4
|
|
- name: Download artifacts
|
|
uses: christopherhx/gitea-download-artifact@v4
|
|
with:
|
|
name: firmware
|
|
path: firmware
|
|
# - name: Display structure of downloaded files
|
|
# run: ls -R
|
|
- name: release
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
files: |-
|
|
**/firmware_*.bin
|
|
body_path: "CHANGELOG.md" |