Compare commits
18 Commits
v1.2.35
...
7ae26fb0a9
Author | SHA1 | Date | |
---|---|---|---|
7ae26fb0a9 | |||
98bcf98f1e | |||
bc8ac32fee | |||
ba74eca21d | |||
d4e1cf1322 | |||
5170784e44 | |||
ac323167d0 | |||
003de5bc00 | |||
83595cfadf | |||
cfe21d63d7 | |||
63e72076ed | |||
2a011ee244 | |||
84dd2bd40b | |||
1449cacc0e | |||
f1c2b2eb87 | |||
0f1a3b1d5b | |||
6190cf04db | |||
680aed0e10 |
114
.github/workflows/providers/gitea-release.yml
vendored
114
.github/workflows/providers/gitea-release.yml
vendored
@ -2,6 +2,22 @@ name: Gitea Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
gitea_ref_name:
|
||||||
|
description: 'Gitea ref name'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
gitea_server_url:
|
||||||
|
description: 'Gitea server URL'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
gitea_repository:
|
||||||
|
description: 'Gitea repository'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
GITEA_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
@ -10,53 +26,37 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Build Dependencies
|
- name: Install System Dependencies
|
||||||
run: |
|
run: |
|
||||||
# System-Level Dependencies
|
|
||||||
echo "Installing system dependencies..."
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y python3-minimal python3-pip curl
|
sudo apt-get install -y python3 python3-venv build-essential curl git
|
||||||
|
|
||||||
# Verify Python installation
|
- name: Set up Python Virtual Environment
|
||||||
echo "Python version:"
|
run: |
|
||||||
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install platformio esptool
|
||||||
|
|
||||||
|
echo "Verifying installations:"
|
||||||
|
platformio --version
|
||||||
python3 --version
|
python3 --version
|
||||||
|
esptool.py version
|
||||||
# Verify pip installation
|
|
||||||
echo "Pip version:"
|
|
||||||
pip3 --version
|
|
||||||
|
|
||||||
# Install Python packages
|
|
||||||
echo "Installing Python packages..."
|
|
||||||
python3 -m pip install --user platformio
|
|
||||||
python3 -m pip install --user esptool
|
|
||||||
|
|
||||||
# Add local bin to PATH
|
|
||||||
echo "${HOME}/.local/bin" >> $GITHUB_PATH
|
|
||||||
export PATH="${HOME}/.local/bin:$PATH"
|
|
||||||
|
|
||||||
# Verify installations
|
|
||||||
echo "PlatformIO version:"
|
|
||||||
pio --version || echo "PlatformIO not found in PATH"
|
|
||||||
|
|
||||||
echo "Esptool version:"
|
|
||||||
esptool.py version || echo "Esptool not found in PATH"
|
|
||||||
|
|
||||||
- name: Build Firmware
|
- name: Build Firmware
|
||||||
run: |
|
run: |
|
||||||
# Ensure PlatformIO is in PATH
|
source venv/bin/activate
|
||||||
export PATH="${HOME}/.local/bin:$PATH"
|
|
||||||
|
|
||||||
echo "Building SPIFFS..."
|
echo "Building SPIFFS..."
|
||||||
python3 -m platformio run -t buildfs
|
platformio run -t buildfs
|
||||||
|
|
||||||
echo "Building firmware..."
|
echo "Building firmware..."
|
||||||
python3 -m platformio run
|
platformio run
|
||||||
|
|
||||||
- name: Merge Firmware Files
|
- name: Create Release Files
|
||||||
run: |
|
run: |
|
||||||
export PATH="${HOME}/.local/bin:$PATH"
|
source venv/bin/activate
|
||||||
|
echo "Creating release files..."
|
||||||
python3 -m esptool --chip esp32 merge_bin \
|
esptool.py --chip esp32 merge_bin \
|
||||||
--flash_mode dio \
|
--flash_mode dio \
|
||||||
--flash_freq 40m \
|
--flash_freq 40m \
|
||||||
--flash_size 4MB \
|
--flash_size 4MB \
|
||||||
@ -69,46 +69,48 @@ 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
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
shell: bash
|
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
GITEA_REF_NAME: ${{ inputs.gitea_ref_name }}
|
||||||
|
GITEA_SERVER_URL: ${{ inputs.gitea_server_url }}
|
||||||
|
GITEA_REPOSITORY: ${{ inputs.gitea_repository }}
|
||||||
run: |
|
run: |
|
||||||
# Basis-Variablen setzen
|
echo "Debug environment:"
|
||||||
API_BASE="${GITEA_SERVER_URL}/api/v1"
|
echo "GITEA_REF_NAME: ${GITEA_REF_NAME}"
|
||||||
REPO="${GITEA_REPOSITORY}"
|
echo "GITEA_SERVER_URL: ${GITEA_SERVER_URL}"
|
||||||
|
echo "GITEA_REPOSITORY: ${GITEA_REPOSITORY}"
|
||||||
|
|
||||||
TAG="${GITEA_REF_NAME}"
|
TAG="${GITEA_REF_NAME}"
|
||||||
|
API_URL="${GITEA_SERVER_URL}/api/v1"
|
||||||
|
REPO="${GITEA_REPOSITORY}"
|
||||||
|
|
||||||
echo "Creating release for ${TAG}..."
|
echo "Creating release for ${TAG} on ${REPO}..."
|
||||||
|
|
||||||
# Release erstellen
|
# Create release
|
||||||
RESPONSE=$(curl -k -f -s \
|
RESPONSE=$(curl -k -s \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "accept: application/json" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
-H "Authorization: token ${GITEA_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_BASE}/repos/${REPO}/releases")
|
"${API_URL}/repos/${REPO}/releases")
|
||||||
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
if [ -n "$RELEASE_ID"; then
|
||||||
echo "Release created with ID: $RELEASE_ID"
|
echo "Release created with ID: $RELEASE_ID"
|
||||||
|
|
||||||
# Binärdateien hochladen
|
# Upload files
|
||||||
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 -f -s \
|
curl -k -s \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "Authorization: token ${GITEA_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_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
|
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Upload completed"
|
|
||||||
else
|
else
|
||||||
echo "Failed to create release"
|
echo "Failed to create release. Response:"
|
||||||
echo "$RESPONSE"
|
echo "$RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@ -10,6 +10,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
provider: ${{ steps.provider.outputs.provider }}
|
provider: ${{ steps.provider.outputs.provider }}
|
||||||
|
gitea_ref_name: ${{ steps.provider.outputs.gitea_ref_name }}
|
||||||
|
gitea_server_url: ${{ steps.provider.outputs.gitea_server_url }}
|
||||||
|
gitea_repository: ${{ steps.provider.outputs.gitea_repository }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -20,25 +23,23 @@ 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"
|
|
||||||
|
|
||||||
# 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
|
||||||
PROVIDER="gitea"
|
echo "provider=gitea" >> "$GITHUB_OUTPUT"
|
||||||
# Then check for GitHub
|
echo "gitea_ref_name=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "gitea_server_url=${GITHUB_SERVER_URL}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "gitea_repository=${GITHUB_REPOSITORY}" >> "$GITHUB_OUTPUT"
|
||||||
elif [ "${GITHUB_ACTIONS}" = "true" ]; then
|
elif [ "${GITHUB_ACTIONS}" = "true" ]; then
|
||||||
PROVIDER="github"
|
echo "provider=github" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "provider=unknown" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Detected provider: ${PROVIDER}"
|
|
||||||
echo "provider=${PROVIDER}" >> "${GITHUB_OUTPUT}"
|
|
||||||
|
|
||||||
verify-provider:
|
verify-provider:
|
||||||
needs: route
|
needs: route
|
||||||
@ -60,4 +61,10 @@ jobs:
|
|||||||
gitea-release:
|
gitea-release:
|
||||||
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:
|
||||||
|
gitea_ref_name: ${{ needs.route.outputs.gitea_ref_name }}
|
||||||
|
gitea_server_url: ${{ needs.route.outputs.gitea_server_url }}
|
||||||
|
gitea_repository: ${{ needs.route.outputs.gitea_repository }}
|
||||||
|
secrets:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
45
CHANGELOG.md
45
CHANGELOG.md
@ -1,5 +1,50 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.2.44] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow to include additional outputs and increment version to 1.2.44
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.43] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow by removing unnecessary outputs and increment version to 1.2.43
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.42] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow to include additional outputs and increment version to 1.2.42
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.41] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow debug output and increment version to 1.2.41
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.40] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- add inputs for Gitea release workflow and increment version to 1.2.40
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.39] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow to use Python virtual environment and increment version to 1.2.39
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.38] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow and increment version to 1.2.38
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.37] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow and increment version to 1.2.37
|
||||||
|
|
||||||
|
|
||||||
|
## [1.2.36] - 2025-02-19
|
||||||
|
### Added
|
||||||
|
- update Gitea release workflow and increment version to 1.2.36
|
||||||
|
|
||||||
|
|
||||||
## [1.2.35] - 2025-02-19
|
## [1.2.35] - 2025-02-19
|
||||||
### Added
|
### Added
|
||||||
- update Gitea release workflow and version to 1.2.35
|
- update Gitea release workflow and version to 1.2.35
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.2.35"
|
version = "1.2.44"
|
||||||
|
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
Reference in New Issue
Block a user