Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
a143527dd0 | |||
f2c9818e61 | |||
9e23af29ff | |||
095885442a | |||
359c9b5a6d | |||
b16a7a4c17 | |||
b4ea175757 | |||
ca4671a7dd | |||
7a4b1a934f | |||
77d90bbe83 |
87
.github/workflows/providers/build.yml
vendored
Normal file
87
.github/workflows/providers/build.yml
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
name: Build Firmware
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
version:
|
||||
description: "The version from the tag"
|
||||
value: ${{ jobs.build.outputs.version }}
|
||||
changelog:
|
||||
description: "The changelog for the current version"
|
||||
value: ${{ jobs.build.outputs.changelog }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.get_version.outputs.VERSION }}
|
||||
changelog: ${{ steps.changelog.outputs.CHANGES }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
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: |
|
||||
if [ -n "$GITEA_REF" ]; then
|
||||
echo "VERSION=${GITEA_REF#refs/tags/v}" >> $GITEA_OUTPUT
|
||||
else
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- 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)
|
||||
if [ -n "$GITEA_OUTPUT" ]; then
|
||||
echo "CHANGES<<EOF" >> $GITEA_OUTPUT
|
||||
echo "$CHANGELOG" >> $GITEA_OUTPUT
|
||||
echo "EOF" >> $GITEA_OUTPUT
|
||||
else
|
||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: firmware
|
||||
path: |
|
||||
.pio/build/esp32dev/filaman_full.bin
|
||||
.pio/build/esp32dev/filaman_ota.bin
|
154
.github/workflows/providers/gitea-release.yml
vendored
154
.github/workflows/providers/gitea-release.yml
vendored
@ -1,15 +1,13 @@
|
||||
name: Gitea Release
|
||||
|
||||
on:
|
||||
workflow_call: # This ensures the workflow can only be called from another workflow
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # Required for creating releases
|
||||
issues: read # Required for reading changelog
|
||||
pull-requests: read # Required for reading changelog
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -46,35 +44,137 @@ jobs:
|
||||
|
||||
- name: Prepare OTA firmware
|
||||
run: |
|
||||
# Use PlatformIO to create a proper OTA image
|
||||
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
|
||||
run: |
|
||||
TAG="${GITEA_REF_NAME}"
|
||||
VERSION="${TAG#v}"
|
||||
echo "VERSION=$VERSION" >> $GITEA_OUTPUT
|
||||
|
||||
- name: Read CHANGELOG.md
|
||||
id: changelog
|
||||
run: |
|
||||
CHANGELOG=$(awk "/## \\[${{ steps.get_version.outputs.VERSION }}\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
|
||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Install and Configure GitHub CLI
|
||||
run: |
|
||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||
&& sudo apt update \
|
||||
&& sudo apt install gh -y
|
||||
|
||||
- name: Create Release with GitHub CLI
|
||||
VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||
CHANGELOG=$(awk "/## \\[$VERSION\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
|
||||
echo "CHANGES<<EOF" >> $GITEA_OUTPUT
|
||||
echo "$CHANGELOG" >> $GITEA_OUTPUT
|
||||
echo "EOF" >> $GITEA_OUTPUT
|
||||
|
||||
- name: Create Gitea Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
gh release create "${{ github.ref_name }}" \
|
||||
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
|
||||
--notes "${{ steps.changelog.outputs.CHANGES }}" \
|
||||
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
||||
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
||||
# Debug: Print all environment variables (excluding the token)
|
||||
env | grep -v "GITEA_TOKEN"
|
||||
|
||||
# Remove trailing slash from server URL if present
|
||||
SERVER_URL="${GITEA_SERVER_URL%/}"
|
||||
REPO="${GITEA_REPOSITORY}"
|
||||
TAG="${GITEA_REF_NAME}"
|
||||
VERSION="${TAG#v}" # Remove v prefix if present
|
||||
|
||||
echo "Debug environment:"
|
||||
echo "Server URL: $SERVER_URL"
|
||||
echo "Repository: $REPO"
|
||||
echo "Tag: $TAG"
|
||||
echo "Version: $VERSION"
|
||||
|
||||
# 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"
|
||||
|
||||
# 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}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"Release ${VERSION}\",\"draft\":false,\"prerelease\":false}" \
|
||||
"${RELEASE_URL}" 2>&1)
|
||||
|
||||
echo "Full release creation response (including headers):"
|
||||
echo "$RELEASE_RESPONSE"
|
||||
|
||||
# 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"
|
||||
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 "@.pio/build/esp32dev/${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='${{ steps.changelog.outputs.CHANGES }}'
|
||||
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"
|
38
.github/workflows/providers/github-release.yml
vendored
38
.github/workflows/providers/github-release.yml
vendored
@ -1,18 +1,13 @@
|
||||
name: Github Release
|
||||
name: GitHub Release
|
||||
|
||||
on:
|
||||
workflow_call: # This ensures the workflow can only be called from another workflow
|
||||
|
||||
permissions:
|
||||
contents: write # Required for creating releases
|
||||
issues: read # Required for reading changelog
|
||||
pull-requests: read # Required for reading changelog
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # Required for creating releases at job level
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -49,35 +44,28 @@ jobs:
|
||||
|
||||
- name: Prepare OTA firmware
|
||||
run: |
|
||||
# Use PlatformIO to create a proper OTA image
|
||||
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
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read CHANGELOG.md
|
||||
id: changelog
|
||||
run: |
|
||||
CHANGELOG=$(awk "/## \\[${{ steps.get_version.outputs.VERSION }}\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
|
||||
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: Install and Configure GitHub CLI
|
||||
run: |
|
||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||
&& sudo apt update \
|
||||
&& sudo apt install gh -y
|
||||
|
||||
- name: Create Release with GitHub CLI
|
||||
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh release create "${{ github.ref_name }}" \
|
||||
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
|
||||
--notes "${{ steps.changelog.outputs.CHANGES }}" \
|
||||
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
||||
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
||||
.pio/build/esp32dev/filaman_full.bin \
|
||||
.pio/build/esp32dev/filaman_ota.bin
|
25
CHANGELOG.md
25
CHANGELOG.md
@ -1,5 +1,30 @@
|
||||
# Changelog
|
||||
|
||||
## [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
|
||||
|
||||
|
||||
## [1.2.28] - 2025-02-19
|
||||
### Added
|
||||
- add build and release workflows for Gitea and GitHub, increment version to 1.2.28
|
||||
|
||||
|
||||
## [1.2.27] - 2025-02-19
|
||||
### Added
|
||||
- enhance CI workflows with provider detection and update version to 1.2.27
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version">v1.2.4</span></h1>
|
||||
<h1>FilaMan<span class="version">v1.2.29</span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[common]
|
||||
version = "1.2.27"
|
||||
version = "1.2.32"
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
|
Reference in New Issue
Block a user