Compare commits

...

16 Commits

Author SHA1 Message Date
f1c2b2eb87 docs: update changelog for version 1.2.37
Some checks failed
Release Workflow / route (push) Successful in 7s
Release Workflow / verify-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 10s
2025-02-19 11:46:19 +01:00
0f1a3b1d5b feat: update Gitea release workflow and increment version to 1.2.37 2025-02-19 11:46:17 +01:00
6190cf04db docs: update changelog for version 1.2.36
Some checks failed
Release Workflow / route (push) Successful in 12s
Release Workflow / verify-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 45s
2025-02-19 11:38:39 +01:00
680aed0e10 feat: update Gitea release workflow and increment version to 1.2.36 2025-02-19 11:38:37 +01:00
fadb122d28 docs: update changelog for version 1.2.35
Some checks failed
Release Workflow / route (push) Successful in 20s
Release Workflow / verify-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 18s
2025-02-19 11:18:07 +01:00
4347f89c16 feat: update Gitea release workflow and version to 1.2.35 2025-02-19 11:18:05 +01:00
9856757e49 docs: update changelog for version 1.2.34
All checks were successful
Release Workflow / route (push) Successful in 12s
Release Workflow / verify-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Has been skipped
2025-02-19 11:01:57 +01:00
afb7b5f42b feat: update version to 1.2.34 and enhance Gitea and GitHub release workflows 2025-02-19 11:01:54 +01:00
ba8506247b docs: update changelog for version 1.2.33
All checks were successful
Release Workflow / route (push) Successful in 12s
Release Workflow / verify-provider (push) Successful in 8s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Has been skipped
2025-02-19 11:00:03 +01:00
61f3f90d6d feat: update version to 1.2.33 and refactor release workflows for Gitea and GitHub 2025-02-19 11:00:01 +01:00
a143527dd0 docs: update changelog for version 1.2.32
Some checks failed
Release Workflow / route (push) Successful in 7s
Release Workflow / verify-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 2m24s
2025-02-19 10:58:53 +01:00
f2c9818e61 feat: update version to 1.2.32 and adjust workflow dependencies for GitHub and Gitea releases 2025-02-19 10:58:51 +01:00
9e23af29ff docs: update changelog for version 1.2.31
All checks were successful
Release Workflow / route (push) Successful in 7s
Release Workflow / verify-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Has been skipped
2025-02-19 10:58:06 +01:00
095885442a feat: update version to 1.2.31 2025-02-19 10:58:04 +01:00
359c9b5a6d docs: update changelog for version 1.2.30
All checks were successful
Release Workflow / route (push) Successful in 6s
Release Workflow / verify-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Has been skipped
2025-02-19 10:50:09 +01:00
b16a7a4c17 feat: update version to 1.2.30 and enhance release workflows for Gitea and GitHub with improved artifact handling and changelog integration 2025-02-19 10:50:06 +01:00
5 changed files with 184 additions and 140 deletions

View File

@ -2,136 +2,103 @@ name: Gitea Release
on:
workflow_call:
secrets:
GITEA_TOKEN:
required: true
jobs:
build:
uses: ./.github/workflows/providers/build.yml
create-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: firmware
path: firmware
- name: Checkout Repository
uses: actions/checkout@v4
- name: Create Gitea Release
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
- name: Install Build Dependencies
run: |
# Debug: Print all environment variables (excluding the token)
env | grep -v "GITEA_TOKEN"
# Add PlatformIO repository
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
# Remove trailing slash from server URL if present
SERVER_URL="${GITEA_SERVER_URL%/}"
REPO="${GITEA_REPOSITORY}"
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
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 install -y platformio-core python3-pip build-essential
# Install esptool
sudo pip3 install esptool==4.5.1
echo "Verifying installations:"
pio --version
python3 --version
esptool.py version
- name: Build Firmware
run: |
# Initialize project
pio project init --board esp32dev
echo "Building SPIFFS..."
pio run -t buildfs -v
echo "Building firmware..."
pio run -v
- name: Create Release Files
run: |
echo "Creating release files..."
esptool.py --chip esp32 merge_bin \
--flash_mode dio \
--flash_freq 40m \
--flash_size 4MB \
-o .pio/build/esp32dev/filaman_full.bin \
0x1000 .pio/build/esp32dev/bootloader.bin \
0x8000 .pio/build/esp32dev/partitions.bin \
0x10000 .pio/build/esp32dev/firmware.bin \
0x290000 .pio/build/esp32dev/spiffs.bin
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
- name: Create Release
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
TAG="${GITEA_REF_NAME}"
VERSION="${TAG#v}" # Remove v prefix if present
API_URL="${GITEA_SERVER_URL}/api/v1"
REPO="${GITEA_REPOSITORY}"
echo "Debug environment:"
echo "Server URL: $SERVER_URL"
echo "Repository: $REPO"
echo "Tag: $TAG"
echo "Version: $VERSION"
echo "TAG: ${TAG}"
echo "API_URL: ${API_URL}"
echo "REPO: ${REPO}"
# Test API connectivity
echo "Testing API connectivity..."
TEST_RESPONSE=$(curl -v -k -H "Authorization: token ${GITEA_TOKEN}" "${SERVER_URL}/api/v1/version" 2>&1)
echo "API Test Response:"
echo "$TEST_RESPONSE"
echo "Creating release for ${TAG} on ${REPO}..."
# Construct clean API URL
API_URL="${SERVER_URL}/api/v1"
RELEASE_URL="${API_URL}/repos/${REPO}/releases"
echo "Using Release API URL: $RELEASE_URL"
# Common curl options
CURL_OPTS="-v -k" # -v for verbose, -k to ignore SSL verification
# Create release with minimal data first
echo "Creating release..."
RELEASE_RESPONSE=$(curl $CURL_OPTS -X POST \
-H "accept: application/json" \
-H "Authorization: token ${GITEA_TOKEN}" \
# Create release
RESPONSE=$(curl -k -s \
-X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"Release ${VERSION}\",\"draft\":false,\"prerelease\":false}" \
"${RELEASE_URL}" 2>&1)
-d "{\"tag_name\":\"${TAG}\",\"name\":\"Release ${TAG}\"}" \
"${API_URL}/repos/${REPO}/releases")
echo "Full release creation response (including headers):"
echo "$RELEASE_RESPONSE"
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | cut -d':' -f2 | head -n1)
# Extract the JSON response (last line)
RELEASE_JSON=$(echo "$RELEASE_RESPONSE" | tail -n 1)
echo "Release JSON response:"
echo "$RELEASE_JSON" | jq '.' || echo "Failed to parse JSON response"
# Get release ID
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
echo "Failed to create release. Full response:"
echo "$RELEASE_RESPONSE"
# Try to get more detailed error information
ERROR_MSG=$(echo "$RELEASE_JSON" | jq -r '.message // .error // "Unknown error"')
echo "Error message: $ERROR_MSG"
if [ -n "$RELEASE_ID" ]; then
echo "Release created with ID: $RELEASE_ID"
# Upload files
for file in "filaman_full.bin" "filaman_ota.bin"; do
echo "Uploading $file..."
curl -k -s \
-X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@.pio/build/esp32dev/$file" \
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
done
else
echo "Failed to create release. Response:"
echo "$RESPONSE"
exit 1
fi
echo "Successfully created release with ID: $RELEASE_ID"
# Upload assets
for file in "filaman_full.bin" "filaman_ota.bin"; do
echo "Uploading $file..."
UPLOAD_URL="${RELEASE_URL}/${RELEASE_ID}/assets?name=${file}"
echo "Upload URL: $UPLOAD_URL"
UPLOAD_RESPONSE=$(curl $CURL_OPTS -X POST \
-H "accept: application/json" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary "@firmware/${file}" \
"${UPLOAD_URL}" 2>&1)
echo "Full upload response for $file (including headers):"
echo "$UPLOAD_RESPONSE"
# Extract the JSON response (last line)
UPLOAD_JSON=$(echo "$UPLOAD_RESPONSE" | tail -n 1)
echo "Upload JSON response:"
echo "$UPLOAD_JSON" | jq '.' || echo "Failed to parse JSON response"
if ! echo "$UPLOAD_JSON" | jq -e '.id' > /dev/null; then
echo "Failed to upload $file. Full response:"
echo "$UPLOAD_RESPONSE"
ERROR_MSG=$(echo "$UPLOAD_JSON" | jq -r '.message // .error // "Unknown error"')
echo "Error message: $ERROR_MSG"
exit 1
fi
echo "Successfully uploaded $file"
done
# Update release with full description after successful file upload
echo "Updating release description..."
CHANGELOG='${{ needs.build.outputs.changelog }}'
UPDATE_RESPONSE=$(curl $CURL_OPTS -X PATCH \
-H "accept: application/json" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"body\":$(echo "$CHANGELOG" | jq -R -s .)}" \
"${RELEASE_URL}/${RELEASE_ID}" 2>&1)
echo "Full update response (including headers):"
echo "$UPDATE_RESPONSE"
# Extract the JSON response (last line)
UPDATE_JSON=$(echo "$UPDATE_RESPONSE" | tail -n 1)
echo "Update JSON response:"
echo "$UPDATE_JSON" | jq '.' || echo "Failed to parse JSON response"
echo "Release process completed"
fi

View File

@ -4,27 +4,68 @@ on:
workflow_call:
jobs:
build:
uses: ./.github/workflows/providers/build.yml
create-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
name: firmware
path: firmware
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Build Firmware
run: |
pio run -t buildfs # Build SPIFFS
pio run # Build firmware
- name: Install esptool
run: |
pip install esptool
- name: Merge firmware and SPIFFS
run: |
esptool.py --chip esp32 merge_bin \
--flash_mode dio \
--flash_freq 40m \
--flash_size 4MB \
-o .pio/build/esp32dev/filaman_full.bin \
0x1000 .pio/build/esp32dev/bootloader.bin \
0x8000 .pio/build/esp32dev/partitions.bin \
0x10000 .pio/build/esp32dev/firmware.bin \
0x290000 .pio/build/esp32dev/spiffs.bin
- name: Prepare OTA firmware
run: |
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
- name: Get version from tag
id: get_version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Read CHANGELOG.md
id: changelog
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
CHANGELOG=$(awk "/## \\[$VERSION\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
--title "Release ${{ needs.build.outputs.version }}" \
--notes "${{ needs.build.outputs.changelog }}" \
firmware/filaman_full.bin \
firmware/filaman_ota.bin
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
--notes "${{ steps.changelog.outputs.CHANGES }}" \
.pio/build/esp32dev/filaman_full.bin \
.pio/build/esp32dev/filaman_ota.bin

View File

@ -26,19 +26,13 @@ jobs:
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"
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 +54,6 @@ 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
secrets:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}

View File

@ -1,5 +1,45 @@
# 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
### 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
## [1.2.34] - 2025-02-19
### Added
- update version to 1.2.34 and enhance Gitea and GitHub release workflows
## [1.2.33] - 2025-02-19
### Added
- update version to 1.2.33 and refactor release workflows for Gitea and GitHub
## [1.2.32] - 2025-02-19
### Added
- update version to 1.2.32 and adjust workflow dependencies for GitHub and Gitea releases
## [1.2.31] - 2025-02-19
### Added
- update version to 1.2.31
## [1.2.30] - 2025-02-19
### Added
- update version to 1.2.30 and enhance release workflows for Gitea and GitHub with improved artifact handling and changelog integration
## [1.2.29] - 2025-02-19
### Added
- update version to 1.2.29 and enhance Gitea release workflow with improved error handling and debugging

View File

@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[common]
version = "1.2.29"
version = "1.2.37"
[env:esp32dev]
platform = espressif32