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:
|
||||
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:
|
||||
create-release:
|
||||
@ -10,53 +26,37 @@ jobs:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Build Dependencies
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
# System-Level Dependencies
|
||||
echo "Installing system dependencies..."
|
||||
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
|
||||
echo "Python version:"
|
||||
- name: Set up Python Virtual Environment
|
||||
run: |
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install platformio esptool
|
||||
|
||||
echo "Verifying installations:"
|
||||
platformio --version
|
||||
python3 --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"
|
||||
esptool.py version
|
||||
|
||||
- name: Build Firmware
|
||||
run: |
|
||||
# Ensure PlatformIO is in PATH
|
||||
export PATH="${HOME}/.local/bin:$PATH"
|
||||
|
||||
source venv/bin/activate
|
||||
echo "Building SPIFFS..."
|
||||
python3 -m platformio run -t buildfs
|
||||
platformio run -t buildfs
|
||||
|
||||
echo "Building firmware..."
|
||||
python3 -m platformio run
|
||||
platformio run
|
||||
|
||||
- name: Merge Firmware Files
|
||||
- name: Create Release Files
|
||||
run: |
|
||||
export PATH="${HOME}/.local/bin:$PATH"
|
||||
|
||||
python3 -m esptool --chip esp32 merge_bin \
|
||||
source venv/bin/activate
|
||||
echo "Creating release files..."
|
||||
esptool.py --chip esp32 merge_bin \
|
||||
--flash_mode dio \
|
||||
--flash_freq 40m \
|
||||
--flash_size 4MB \
|
||||
@ -69,46 +69,48 @@ jobs:
|
||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
||||
|
||||
- name: Create Release
|
||||
shell: bash
|
||||
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: |
|
||||
# Basis-Variablen setzen
|
||||
API_BASE="${GITEA_SERVER_URL}/api/v1"
|
||||
REPO="${GITEA_REPOSITORY}"
|
||||
echo "Debug environment:"
|
||||
echo "GITEA_REF_NAME: ${GITEA_REF_NAME}"
|
||||
echo "GITEA_SERVER_URL: ${GITEA_SERVER_URL}"
|
||||
echo "GITEA_REPOSITORY: ${GITEA_REPOSITORY}"
|
||||
|
||||
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
|
||||
RESPONSE=$(curl -k -f -s \
|
||||
# Create release
|
||||
RESPONSE=$(curl -k -s \
|
||||
-X POST \
|
||||
-H "accept: application/json" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-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)
|
||||
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"
|
||||
|
||||
# Binärdateien hochladen
|
||||
# Upload files
|
||||
for file in "filaman_full.bin" "filaman_ota.bin"; do
|
||||
echo "Uploading $file..."
|
||||
curl -k -f -s \
|
||||
curl -k -s \
|
||||
-X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--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
|
||||
|
||||
echo "Upload completed"
|
||||
else
|
||||
echo "Failed to create release"
|
||||
echo "Failed to create release. Response:"
|
||||
echo "$RESPONSE"
|
||||
exit 1
|
||||
fi
|
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@ -10,6 +10,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
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:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
@ -20,25 +23,23 @@ jobs:
|
||||
echo "GITHUB_ACTIONS=${GITHUB_ACTIONS:-not set}"
|
||||
echo "GITEA_ACTIONS=${GITEA_ACTIONS:-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}"
|
||||
|
||||
- name: Determine CI Provider
|
||||
id: provider
|
||||
shell: bash
|
||||
run: |
|
||||
# Initialize provider as unknown
|
||||
PROVIDER="unknown"
|
||||
|
||||
# Check for Gitea specific environment first
|
||||
if [ -n "${GITEA_ACTIONS}" ] || [ -n "${GITEA_REPOSITORY}" ] || [[ "${RUNNER_NAME}" == *"gitea"* ]]; then
|
||||
PROVIDER="gitea"
|
||||
# Then check for GitHub
|
||||
echo "provider=gitea" >> "$GITHUB_OUTPUT"
|
||||
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
|
||||
PROVIDER="github"
|
||||
echo "provider=github" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "provider=unknown" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
echo "Detected provider: ${PROVIDER}"
|
||||
echo "provider=${PROVIDER}" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
verify-provider:
|
||||
needs: route
|
||||
@ -60,4 +61,10 @@ jobs:
|
||||
gitea-release:
|
||||
needs: [route, verify-provider]
|
||||
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
|
||||
|
||||
## [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
|
||||
### Added
|
||||
- update Gitea release workflow and version to 1.2.35
|
||||
|
@ -9,7 +9,7 @@
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[common]
|
||||
version = "1.2.35"
|
||||
version = "1.2.44"
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
|
Reference in New Issue
Block a user