Add release workflow
This commit is contained in:
parent
0bf5cb1c14
commit
f5e735a6a8
@ -18,3 +18,4 @@ jobs:
|
||||
- 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
|
||||
|
||||
|
||||
31
.gitea/workflows/release.yaml
Normal file
31
.gitea/workflows/release.yaml
Normal 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/**
|
||||
31
build.sh
31
build.sh
@ -2,10 +2,10 @@
|
||||
|
||||
set -ueo pipefail
|
||||
|
||||
if (( $# != 1 )); then
|
||||
if (( $# < 1 )); then
|
||||
echo "Invalid CLI args."
|
||||
echo "Usage:"
|
||||
echo "./build.sh path/to/printer.env"
|
||||
echo "./build.sh path/to/printer.env [-c]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -15,33 +15,52 @@ if ! [ -f "$1" ]; then
|
||||
exit 1
|
||||
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 -n "Loading config variables... "
|
||||
source "$1"
|
||||
echo "OK"
|
||||
|
||||
if (( $TEST_MODE == 0 )); then
|
||||
filename="fw-${name// /_}-${board// /_}-ver$config_version.$fw_ext"
|
||||
echo "Artifact name will be: ""$filename"""
|
||||
fi
|
||||
|
||||
if ! [ -d Marlin ]; then
|
||||
git clone https://github.com/MarlinFirmware/Marlin --depth 1
|
||||
cd Marlin
|
||||
else
|
||||
cd Marlin
|
||||
git pull
|
||||
git fetch --all
|
||||
git reset --hard origin/bugfix-2.1.x
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo -n "Copying custom config files... "
|
||||
cp "$(dirname "$1")"/*.h Marlin/
|
||||
cp "$(dirname "$1")"/*.h Marlin/Marlin/
|
||||
echo "OK"
|
||||
|
||||
cd Marlin
|
||||
if (( $TEST_MODE == 0 )); then
|
||||
echo "Running PlatformIO build!"
|
||||
pio run -e "$pio_env"
|
||||
echo -n "Finished building. Copying firmware."$fw_ext"... "
|
||||
mkdir -p ../output
|
||||
cp .pio/build/"$pio_env"/firmware.$fw_ext ../output/"$filename"
|
||||
echo "OK"
|
||||
cd ..
|
||||
else
|
||||
echo "Running PlatformIO checks!"
|
||||
pio check -e "$pio_env"
|
||||
echo -n "Finished checks."
|
||||
fi
|
||||
cd ../../
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user