Compare commits
No commits in common. "f1c2b2eb874f37c16eed3487411ba31844916f58" and "6190cf04dbcdc684e7998135f3b104810df4605d" have entirely different histories.
f1c2b2eb87
...
6190cf04db
132
.github/workflows/providers/gitea-release.yml
vendored
132
.github/workflows/providers/gitea-release.yml
vendored
@ -2,6 +2,12 @@ name: Gitea Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
server_url:
|
||||||
|
description: 'Gitea server URL'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: 'https://gitea.your-domain.com'
|
||||||
secrets:
|
secrets:
|
||||||
GITEA_TOKEN:
|
GITEA_TOKEN:
|
||||||
required: true
|
required: true
|
||||||
@ -9,44 +15,84 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
environment: production
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
|
||||||
- name: Install Build Dependencies
|
- name: Install Build Dependencies
|
||||||
run: |
|
run: |
|
||||||
# Add PlatformIO repository
|
echo "Current directory: $(pwd)"
|
||||||
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
|
|
||||||
|
|
||||||
sudo curl -fsSL -o /etc/apt/trusted.gpg.d/platformio.gpg https://github.com/platformio/platformio-core/releases/download/v6.1.11/platformio-keyring.gpg
|
# Systemabhängigkeiten
|
||||||
echo "deb https://github.com/platformio/platformio-core/releases/download/v6.1.11/ any/" | sudo tee /etc/apt/sources.list.d/platformio.list
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y platformio-core python3-pip build-essential
|
sudo apt-get install -y build-essential gcc git wget
|
||||||
|
|
||||||
# Install esptool
|
# PlatformIO CLI installieren
|
||||||
sudo pip3 install esptool==4.5.1
|
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/get-platformio.py -o get-platformio.py
|
||||||
|
python3 get-platformio.py
|
||||||
|
|
||||||
echo "Verifying installations:"
|
# PATH aktualisieren
|
||||||
|
echo "$HOME/.platformio/penv/bin" >> $GITHUB_PATH
|
||||||
|
export PATH="$HOME/.platformio/penv/bin:$PATH"
|
||||||
|
|
||||||
|
echo "Verifying installation:"
|
||||||
pio --version
|
pio --version
|
||||||
python3 --version
|
python --version
|
||||||
esptool.py version
|
gcc --version
|
||||||
|
|
||||||
- name: Build Firmware
|
echo "Project contents:"
|
||||||
|
ls -la
|
||||||
|
|
||||||
|
- name: Prepare Build Environment
|
||||||
run: |
|
run: |
|
||||||
# Initialize project
|
# PlatformIO Core initialisieren
|
||||||
pio project init --board esp32dev
|
pio platform install "espressif32"
|
||||||
|
|
||||||
|
echo "Installing libraries..."
|
||||||
|
pio lib install \
|
||||||
|
"tzapu/WiFiManager @ ^2.0.17" \
|
||||||
|
"https://github.com/me-no-dev/ESPAsyncWebServer.git" \
|
||||||
|
"me-no-dev/AsyncTCP @ ^1.1.1" \
|
||||||
|
"bogde/HX711 @ ^0.7.5" \
|
||||||
|
"adafruit/Adafruit SSD1306 @ ^2.5.13" \
|
||||||
|
"adafruit/Adafruit GFX Library @ ^1.11.11" \
|
||||||
|
"adafruit/Adafruit PN532 @ ^1.3.3" \
|
||||||
|
"bblanchon/ArduinoJson @ ^7.3.0" \
|
||||||
|
"knolleary/PubSubClient @ ^2.8" \
|
||||||
|
"digitaldragon/SSLClient @ ^1.3.2"
|
||||||
|
|
||||||
|
echo "Installed libraries:"
|
||||||
|
pio lib list
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
run: |
|
||||||
|
# PlatformIO Core Variablen setzen
|
||||||
|
export PLATFORMIO_BUILD_FLAGS="-D VERSION=\\"1.2.35\\" -DNDEBUG"
|
||||||
|
|
||||||
|
echo "Building project..."
|
||||||
|
pio run -e esp32dev -v
|
||||||
|
|
||||||
echo "Building SPIFFS..."
|
echo "Building SPIFFS..."
|
||||||
pio run -t buildfs -v
|
pio run -e esp32dev -t buildfs -v
|
||||||
|
|
||||||
echo "Building firmware..."
|
echo "Build output:"
|
||||||
pio run -v
|
ls -la .pio/build/esp32dev/
|
||||||
|
|
||||||
- name: Create Release Files
|
- name: Merge Firmware Files
|
||||||
run: |
|
run: |
|
||||||
echo "Creating release files..."
|
pip install esptool==4.5.1
|
||||||
|
|
||||||
|
echo "Available files:"
|
||||||
|
ls -la .pio/build/esp32dev/
|
||||||
|
|
||||||
esptool.py --chip esp32 merge_bin \
|
esptool.py --chip esp32 merge_bin \
|
||||||
--flash_mode dio \
|
--flash_mode dio \
|
||||||
--flash_freq 40m \
|
--flash_freq 40m \
|
||||||
@ -59,46 +105,62 @@ jobs:
|
|||||||
|
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
||||||
|
|
||||||
|
echo "Final binaries:"
|
||||||
|
ls -la .pio/build/esp32dev/filaman_*.bin
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
|
shell: bash
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
SERVER_URL: ${{ inputs.server_url }}
|
||||||
run: |
|
run: |
|
||||||
TAG="${GITEA_REF_NAME}"
|
# Basis-Variablen
|
||||||
API_URL="${GITEA_SERVER_URL}/api/v1"
|
API_BASE="${GITEA_SERVER_URL:-${SERVER_URL}}/api/v1"
|
||||||
REPO="${GITEA_REPOSITORY}"
|
REPO="${GITEA_REPOSITORY}"
|
||||||
|
TAG="${GITEA_REF_NAME}"
|
||||||
|
|
||||||
echo "Debug environment:"
|
echo "Release configuration:"
|
||||||
echo "TAG: ${TAG}"
|
echo "API Base: $API_BASE"
|
||||||
echo "API_URL: ${API_URL}"
|
echo "Repository: $REPO"
|
||||||
echo "REPO: ${REPO}"
|
echo "Tag: $TAG"
|
||||||
|
|
||||||
echo "Creating release for ${TAG} on ${REPO}..."
|
# Test API-Verbindung
|
||||||
|
echo "Testing API connection..."
|
||||||
|
curl -k -v \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API_BASE}/version"
|
||||||
|
|
||||||
# Create release
|
# Release erstellen
|
||||||
RESPONSE=$(curl -k -s \
|
echo "Creating release..."
|
||||||
|
RESPONSE=$(curl -k -v \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "Authorization: token ${TOKEN}" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"Release ${TAG}\"}" \
|
-d "{\"tag_name\":\"${TAG}\",\"name\":\"Release ${TAG}\"}" \
|
||||||
"${API_URL}/repos/${REPO}/releases")
|
"${API_BASE}/repos/${REPO}/releases")
|
||||||
|
|
||||||
|
echo "Release response:"
|
||||||
|
echo "$RESPONSE"
|
||||||
|
|
||||||
|
# Release ID extrahieren
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | cut -d':' -f2 | head -n1)
|
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | cut -d':' -f2 | head -n1)
|
||||||
|
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
if [ -n "$RELEASE_ID" ]; then
|
||||||
echo "Release created with ID: $RELEASE_ID"
|
echo "Release created with ID: $RELEASE_ID"
|
||||||
|
|
||||||
# Upload files
|
# Binärdateien hochladen
|
||||||
for file in "filaman_full.bin" "filaman_ota.bin"; do
|
for file in "filaman_full.bin" "filaman_ota.bin"; do
|
||||||
echo "Uploading $file..."
|
echo "Uploading $file..."
|
||||||
curl -k -s \
|
curl -k -v \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "Authorization: token ${TOKEN}" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--data-binary "@.pio/build/esp32dev/$file" \
|
--data-binary "@.pio/build/esp32dev/$file" \
|
||||||
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
|
"${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Upload completed"
|
||||||
else
|
else
|
||||||
echo "Failed to create release. Response:"
|
echo "Failed to create release"
|
||||||
echo "$RESPONSE"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
26
.github/workflows/release.yml
vendored
26
.github/workflows/release.yml
vendored
@ -10,6 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
provider: ${{ steps.provider.outputs.provider }}
|
provider: ${{ steps.provider.outputs.provider }}
|
||||||
|
server_url: ${{ steps.provider.outputs.server_url }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -20,20 +21,34 @@ jobs:
|
|||||||
echo "GITHUB_ACTIONS=${GITHUB_ACTIONS:-not set}"
|
echo "GITHUB_ACTIONS=${GITHUB_ACTIONS:-not set}"
|
||||||
echo "GITEA_ACTIONS=${GITEA_ACTIONS:-not set}"
|
echo "GITEA_ACTIONS=${GITEA_ACTIONS:-not set}"
|
||||||
echo "GITEA_REPOSITORY=${GITEA_REPOSITORY:-not set}"
|
echo "GITEA_REPOSITORY=${GITEA_REPOSITORY:-not set}"
|
||||||
|
echo "GITEA_SERVER_URL=${GITEA_SERVER_URL:-not set}"
|
||||||
echo "RUNNER_NAME=${RUNNER_NAME:-not set}"
|
echo "RUNNER_NAME=${RUNNER_NAME:-not set}"
|
||||||
|
|
||||||
- name: Determine CI Provider
|
- name: Determine CI Provider
|
||||||
id: provider
|
id: provider
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
# Initialize provider as unknown
|
||||||
|
PROVIDER="unknown"
|
||||||
|
SERVER_URL=""
|
||||||
|
|
||||||
|
# Check for Gitea specific environment first
|
||||||
if [ -n "${GITEA_ACTIONS}" ] || [ -n "${GITEA_REPOSITORY}" ] || [[ "${RUNNER_NAME}" == *"gitea"* ]]; then
|
if [ -n "${GITEA_ACTIONS}" ] || [ -n "${GITEA_REPOSITORY}" ] || [[ "${RUNNER_NAME}" == *"gitea"* ]]; then
|
||||||
echo "provider=gitea" >> "$GITHUB_OUTPUT"
|
PROVIDER="gitea"
|
||||||
|
SERVER_URL="${GITEA_SERVER_URL}"
|
||||||
|
# Then check for GitHub
|
||||||
elif [ "${GITHUB_ACTIONS}" = "true" ]; then
|
elif [ "${GITHUB_ACTIONS}" = "true" ]; then
|
||||||
echo "provider=github" >> "$GITHUB_OUTPUT"
|
PROVIDER="github"
|
||||||
else
|
|
||||||
echo "provider=unknown" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Detected provider: ${PROVIDER}"
|
||||||
|
echo "Server URL: ${SERVER_URL}"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "provider=${PROVIDER}"
|
||||||
|
echo "server_url=${SERVER_URL}"
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
verify-provider:
|
verify-provider:
|
||||||
needs: route
|
needs: route
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -41,6 +56,7 @@ jobs:
|
|||||||
- name: Echo detected provider
|
- name: Echo detected provider
|
||||||
run: |
|
run: |
|
||||||
echo "Detected CI Provider: ${{ needs.route.outputs.provider }}"
|
echo "Detected CI Provider: ${{ needs.route.outputs.provider }}"
|
||||||
|
echo "Server URL: ${{ needs.route.outputs.server_url }}"
|
||||||
if [ "${{ needs.route.outputs.provider }}" = "unknown" ]; then
|
if [ "${{ needs.route.outputs.provider }}" = "unknown" ]; then
|
||||||
echo "::error::Failed to detect CI provider!"
|
echo "::error::Failed to detect CI provider!"
|
||||||
exit 1
|
exit 1
|
||||||
@ -55,5 +71,7 @@ jobs:
|
|||||||
needs: [route, verify-provider]
|
needs: [route, verify-provider]
|
||||||
if: needs.route.outputs.provider == 'gitea'
|
if: needs.route.outputs.provider == 'gitea'
|
||||||
uses: ./.github/workflows/providers/gitea-release.yml
|
uses: ./.github/workflows/providers/gitea-release.yml
|
||||||
|
with:
|
||||||
|
server_url: ${{ needs.route.outputs.server_url }}
|
||||||
secrets:
|
secrets:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
@ -1,10 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [1.2.37] - 2025-02-19
|
|
||||||
### Added
|
|
||||||
- update Gitea release workflow and increment version to 1.2.37
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.36] - 2025-02-19
|
## [1.2.36] - 2025-02-19
|
||||||
### Added
|
### Added
|
||||||
- update Gitea release workflow and increment version to 1.2.36
|
- update Gitea release workflow and increment version to 1.2.36
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.2.37"
|
version = "1.2.36"
|
||||||
|
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user