36 lines
948 B
YAML
36 lines
948 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install build deps
|
|
run: apt update && apt upgrade -y && apt install gcc-riscv64-unknown-elf libnewlib-dev libudev-dev libusb-1.0-0-dev git build-essential -y
|
|
|
|
- name: Clone ch32fun repo
|
|
run: |
|
|
mkdir -p $HOME/git/ch32fun
|
|
git clone https://github.com/cnlohr/ch32fun.git $HOME/git/ch32fun
|
|
|
|
- name: Compile binary
|
|
run: make
|
|
|
|
- name: Generate checksum
|
|
run: sha256sum build/fan_controller.bin > build/fan_controller.bin.sha256
|
|
|
|
- name: Create Release and upload assets
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
build/firmware.bin
|
|
build/firmware.bin.sha256
|
|
env:
|
|
GITHUB_TOKEN: ${{ vars.OCI_ACCESS_TOKEN }} |