Add release workflow

This commit is contained in:
August 2026-11-08 19:57:28 +00:00
parent 0bf5cb1c14
commit f5e735a6a8
Signed by: shibedrill
SSH Key Fingerprint: SHA256:M0m3JW1s38BgO2t0fG146Yxd9OJ2IOqkvCAsuRHQ6Pw
3 changed files with 65 additions and 14 deletions

View File

@ -18,3 +18,4 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: python3 -m pip install platformio - run: python3 -m pip install platformio
- run: ${{ gitea.workspace }}/build.sh ${{ gitea.workspace }}/Configs/FLSUN/Kossel/MakerBase\ MKS\ Gen\ L/printer.env - run: ${{ gitea.workspace }}/build.sh ${{ gitea.workspace }}/Configs/FLSUN/Kossel/MakerBase\ MKS\ Gen\ L/printer.env

View File

@ -0,0 +1,31 @@
name: Release Asset
on:
push:
tags:
- "*"
jobs:
creality-ender-3-pro-release:
name: Creality Ender 3 Pro - Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python3 -m pip install platformio
- run: ${{ gitea.workspace }}/build.sh ${{ gitea.workspace }}/Configs/Creality/Ender-3\ Pro/BigTreeTech\ SKR\ Mini\ E3\ 3.0/printer.env
- uses: akkuman/gitea-release-action@v1
with:
files: |-
output/**
flsun-kossel-release:
name: FLSUN Kossel - Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python3 -m pip install platformio
- run: ${{ gitea.workspace }}/build.sh ${{ gitea.workspace }}/Configs/FLSUN/Kossel/MakerBase\ MKS\ Gen\ L/printer.env
- uses: akkuman/gitea-release-action@v1
with:
files: |-
output/**

View File

@ -2,10 +2,10 @@
set -ueo pipefail set -ueo pipefail
if (( $# != 1 )); then if (( $# < 1 )); then
echo "Invalid CLI args." echo "Invalid CLI args."
echo "Usage:" echo "Usage:"
echo "./build.sh path/to/printer.env" echo "./build.sh path/to/printer.env [-c]"
exit 1 exit 1
fi fi
@ -15,33 +15,52 @@ if ! [ -f "$1" ]; then
exit 1 exit 1
fi fi
if (( $# == 2 )); then
if [ $2 == "-c" ]; then
echo "Check mode- will not compile a binary!!!"
export TEST_MODE=1
fi
else
export TEST_MODE=0
fi
echo "Printer env file found: $1" echo "Printer env file found: $1"
echo -n "Loading config variables... " echo -n "Loading config variables... "
source "$1" source "$1"
echo "OK" echo "OK"
if (( $TEST_MODE == 0 )); then
filename="fw-${name// /_}-${board// /_}-ver$config_version.$fw_ext" filename="fw-${name// /_}-${board// /_}-ver$config_version.$fw_ext"
echo "Artifact name will be: ""$filename""" echo "Artifact name will be: ""$filename"""
fi
if ! [ -d Marlin ]; then if ! [ -d Marlin ]; then
git clone https://github.com/MarlinFirmware/Marlin --depth 1 git clone https://github.com/MarlinFirmware/Marlin --depth 1
cd Marlin
else else
cd Marlin cd Marlin
git pull git fetch --all
git reset --hard origin/bugfix-2.1.x
cd ..
fi fi
echo -n "Copying custom config files... " echo -n "Copying custom config files... "
cp "$(dirname "$1")"/*.h Marlin/ cp "$(dirname "$1")"/*.h Marlin/Marlin/
echo "OK" echo "OK"
cd Marlin
if (( $TEST_MODE == 0 )); then
echo "Running PlatformIO build!" echo "Running PlatformIO build!"
pio run -e "$pio_env" pio run -e "$pio_env"
echo -n "Finished building. Copying firmware."$fw_ext"... " echo -n "Finished building. Copying firmware."$fw_ext"... "
mkdir -p ../output mkdir -p ../output
cp .pio/build/"$pio_env"/firmware.$fw_ext ../output/"$filename" cp .pio/build/"$pio_env"/firmware.$fw_ext ../output/"$filename"
echo "OK" echo "OK"
cd .. else
echo "Running PlatformIO checks!"
pio check -e "$pio_env"
echo -n "Finished checks."
fi
cd ../../