From 96c7119005b37a391219428eb19e180cffce2343 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 29 Apr 2026 16:57:55 +0200 Subject: [PATCH] new git-binaries implement for upload --- .gitea/workflows/avr-build.yaml | 33 ++++++++++++++++++++++++++++----- makefile | 2 +- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/avr-build.yaml b/.gitea/workflows/avr-build.yaml index d2733c8..e154471 100644 --- a/.gitea/workflows/avr-build.yaml +++ b/.gitea/workflows/avr-build.yaml @@ -49,8 +49,31 @@ jobs: run: | make BUILD_TYPE=$BUILD_TYPE PREFIX=$PREFIX VERSION=$VERSION - - name: Upload hex - uses: actions/upload-artifact@v4 - with: - name: firmware-${{ env.BUILD_TYPE }} - path: build/**/*.hex \ No newline at end of file + + - name: Publish HEX to binaries repo + run: | + git config --global user.name "gitea-runner" + git config --global user.email "runner@runner.runner" + + # clone binaries repo + git clone https://gitea.swiss-dedi.ch/Lukas/Flextron-Binaries.git bins + + # decide target folder + if [ "$BUILD_TYPE" = "dev" ]; then + TARGET_DIR="bins/dev" + else + TARGET_DIR="bins/live" + fi + + mkdir -p "$TARGET_DIR" + + # copy newest hex + cp $(find build -name "*.hex" | head -n 1) \ + "$TARGET_DIR/${PREFIX}_${VERSION}.hex" + + cd bins + + git add . + git commit -m "CI build $BUILD_TYPE $VERSION" || echo "No changes" + + git push \ No newline at end of file diff --git a/makefile b/makefile index 2945874..ba7da87 100644 --- a/makefile +++ b/makefile @@ -19,7 +19,7 @@ all: $(TARGET).hex $(TARGET).elf: $(SRC) @mkdir -p $(OUTDIR) - $(CC) $(CFLAGS) $< -o $@ + $(CC) $(CFLAGS) $< -o $@ //avr-gcc -mmcu=atmega644pa .... $(TARGET).hex: $(TARGET).elf $(OBJCOPY) -O ihex -R .eeprom $< $@