Compare commits
2 Commits
v1.2.16
...
920e4cfb69
Author | SHA1 | Date | |
---|---|---|---|
920e4cfb69 | |||
e646edd6f4 |
119
.github/workflows/providers/gitea-release.yml
vendored
119
.github/workflows/providers/gitea-release.yml
vendored
@@ -1,23 +1,20 @@
|
|||||||
name: Gitea Release
|
name: Gitea Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
push:
|
||||||
inputs:
|
tags:
|
||||||
version:
|
- 'v*'
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
changelog:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write # Required for creating releases
|
||||||
issues: read
|
issues: read # Required for reading changelog
|
||||||
pull-requests: read
|
pull-requests: read # Required for reading changelog
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -26,17 +23,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install PlatformIO
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install --upgrade platformio esptool
|
pip install --upgrade platformio
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y jq
|
|
||||||
|
|
||||||
- name: Build Firmware
|
- name: Build Firmware
|
||||||
run: |
|
run: |
|
||||||
pio run -t buildfs
|
pio run -t buildfs # Build SPIFFS
|
||||||
pio run
|
pio run # Build firmware
|
||||||
|
|
||||||
|
- name: Install esptool
|
||||||
|
run: |
|
||||||
|
pip install esptool
|
||||||
|
|
||||||
- name: Merge firmware and SPIFFS
|
- name: Merge firmware and SPIFFS
|
||||||
run: |
|
run: |
|
||||||
@@ -51,54 +50,54 @@ jobs:
|
|||||||
0x290000 .pio/build/esp32dev/spiffs.bin
|
0x290000 .pio/build/esp32dev/spiffs.bin
|
||||||
|
|
||||||
- name: Prepare OTA firmware
|
- name: Prepare OTA firmware
|
||||||
run: cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
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: |
|
||||||
|
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: Create Release
|
- name: Create Release
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
|
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
|
||||||
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
|
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
|
||||||
run: |
|
run: |
|
||||||
# Validate and sanitize API URL
|
# Create release using Gitea API
|
||||||
if [[ ! "$GITEA_API_URL" =~ ^https?:// ]]; then
|
RESPONSE=$(curl -X POST \
|
||||||
echo "Error: GITEA_API_URL must start with http:// or https://"
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
exit 1
|
-H "Content-Type: application/json" \
|
||||||
fi
|
-H "accept: application/json" \
|
||||||
|
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases" \
|
||||||
|
-d '{
|
||||||
|
"tag_name": "${{ github.ref_name }}",
|
||||||
|
"name": "Release ${{ steps.get_version.outputs.VERSION }}",
|
||||||
|
"body": "${{ steps.changelog.outputs.CHANGES }}",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}')
|
||||||
|
|
||||||
# Remove trailing slash and ensure /api/v1
|
# Extract release ID from response
|
||||||
GITEA_API_URL="${GITEA_API_URL%/}"
|
RELEASE_ID=$(echo $RESPONSE | jq -r .id)
|
||||||
if [[ ! "$GITEA_API_URL" =~ /api/v1$ ]]; then
|
|
||||||
GITEA_API_URL="${GITEA_API_URL}/api/v1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Creating Gitea release..."
|
# Upload full firmware
|
||||||
release_data="{\"tag_name\":\"${{ github.ref_name }}\",\"name\":\"Release ${{ inputs.version }}\",\"body\":${{ toJSON(inputs.changelog) }},\"draft\":false,\"prerelease\":false}"
|
curl -X POST \
|
||||||
RESPONSE=$(curl -sS -X POST \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
-H "Content-Type: application/json" \
|
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_full.bin" \
|
||||||
-H "Accept: application/json" \
|
--data-binary @.pio/build/esp32dev/filaman_full.bin
|
||||||
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases" \
|
|
||||||
-d "$release_data")
|
|
||||||
|
|
||||||
# Extract and validate release ID
|
# Upload OTA firmware
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r .id)
|
curl -X POST \
|
||||||
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
echo "Error: Failed to get release ID"
|
-H "Content-Type: application/octet-stream" \
|
||||||
echo "API Response:"
|
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_ota.bin" \
|
||||||
echo "$RESPONSE" | jq .
|
--data-binary @.pio/build/esp32dev/filaman_ota.bin
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Upload binary files
|
|
||||||
for file in "filaman_full.bin" "filaman_ota.bin"; do
|
|
||||||
echo "Uploading $file..."
|
|
||||||
if ! curl -sS -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/octet-stream" \
|
|
||||||
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${file}" \
|
|
||||||
--data-binary "@.pio/build/esp32dev/${file}"; then
|
|
||||||
echo "Error: Failed to upload $file"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Successfully uploaded $file"
|
|
||||||
done
|
|
61
.github/workflows/providers/github-release.yml
vendored
61
.github/workflows/providers/github-release.yml
vendored
@@ -1,21 +1,20 @@
|
|||||||
name: GitHub Release
|
name: GitHub Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
push:
|
||||||
inputs:
|
tags:
|
||||||
version:
|
- 'v*'
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
changelog:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write # Required for creating releases
|
||||||
|
issues: read # Required for reading changelog
|
||||||
|
pull-requests: read # Required for reading changelog
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # Required for creating releases at job level
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -24,15 +23,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install PlatformIO
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install --upgrade platformio esptool
|
pip install --upgrade platformio
|
||||||
|
|
||||||
- name: Build Firmware
|
- name: Build Firmware
|
||||||
run: |
|
run: |
|
||||||
pio run -t buildfs
|
pio run -t buildfs # Build SPIFFS
|
||||||
pio run
|
pio run # Build firmware
|
||||||
|
|
||||||
|
- name: Install esptool
|
||||||
|
run: |
|
||||||
|
pip install esptool
|
||||||
|
|
||||||
- name: Merge firmware and SPIFFS
|
- name: Merge firmware and SPIFFS
|
||||||
run: |
|
run: |
|
||||||
@@ -47,14 +50,36 @@ jobs:
|
|||||||
0x290000 .pio/build/esp32dev/spiffs.bin
|
0x290000 .pio/build/esp32dev/spiffs.bin
|
||||||
|
|
||||||
- name: Prepare OTA firmware
|
- name: Prepare OTA firmware
|
||||||
run: cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
run: |
|
||||||
|
# Use PlatformIO to create a proper OTA image
|
||||||
|
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- 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: |
|
||||||
|
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
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
gh release create "${{ github.ref_name }}" \
|
gh release create "${{ github.ref_name }}" \
|
||||||
--title "Release ${{ inputs.version }}" \
|
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
|
||||||
--notes "${{ inputs.changelog }}" \
|
--notes "${{ steps.changelog.outputs.CHANGES }}" \
|
||||||
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
||||||
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
59
.github/workflows/release.yml
vendored
59
.github/workflows/release.yml
vendored
@@ -6,50 +6,27 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-version-and-changelog:
|
detect-and-run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
version: ${{ steps.get_version.outputs.VERSION }}
|
|
||||||
changelog: ${{ steps.changelog.outputs.CHANGES }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
- name: Get version from tag
|
|
||||||
id: get_version
|
- name: Determine hosting platform
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
id: platform
|
||||||
|
|
||||||
- name: Verify version match
|
|
||||||
run: |
|
run: |
|
||||||
PIO_VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
|
if [[ "$GITHUB_SERVER_URL" == "https://github.com" ]]; then
|
||||||
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
|
echo "platform=github" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "$CI_SERVER_URL" == *"gitlab"* ]]; then
|
||||||
if [ "$PIO_VERSION" != "$TAG_VERSION" ]; then
|
echo "platform=gitlab" >> $GITHUB_OUTPUT
|
||||||
echo "Error: Version mismatch between tag ($TAG_VERSION) and platformio.ini ($PIO_VERSION)"
|
else
|
||||||
exit 1
|
echo "platform=gitea" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
github-release:
|
- name: Run GitHub Release
|
||||||
needs: get-version-and-changelog
|
if: steps.platform.outputs.platform == 'github'
|
||||||
if: github.server_url == 'https://github.com'
|
uses: ./.github/workflows/providers/github-release.yml
|
||||||
uses: ./.github/workflows/providers/github-release.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.get-version-and-changelog.outputs.version }}
|
|
||||||
changelog: ${{ needs.get-version-and-changelog.outputs.changelog }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
gitea-release:
|
- name: Run Gitea Release
|
||||||
needs: get-version-and-changelog
|
if: steps.platform.outputs.platform == 'gitea'
|
||||||
if: github.server_url != 'https://github.com'
|
uses: ./.github/workflows/providers/gitea-release.yml
|
||||||
uses: ./.github/workflows/providers/gitea-release.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.get-version-and-changelog.outputs.version }}
|
|
||||||
changelog: ${{ needs.get-version-and-changelog.outputs.changelog }}
|
|
||||||
secrets: inherit
|
|
61
CHANGELOG.md
61
CHANGELOG.md
@@ -1,66 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [1.2.16] - 2025-02-19
|
|
||||||
### Added
|
|
||||||
- update Gitea release workflow and increment version to 1.2.16
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.15] - 2025-02-19
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.15 and clean up Gitea release workflow
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.14] - 2025-02-19
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.14 and refactor release workflows for improved GitHub and Gitea support
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.13] - 2025-02-19
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.13 and enhance release workflow with Python setup and Gitea support
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.12] - 2025-02-19
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.12 and refactor release workflows for improved provider detection and execution
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.11] - 2025-02-18
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.11 and enhance GitHub and Gitea release workflows with input validation and improved error handling
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.10] - 2025-02-18
|
|
||||||
### Added
|
|
||||||
- enhance Gitea release workflow with API connection verification and URL validation; update version to 1.2.10
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.9] - 2025-02-18
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.9 in platformio.ini
|
|
||||||
- refactor GitHub and Gitea release workflows for improved version handling and firmware uploads
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.8] - 2025-02-18
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.8 in platformio.ini; refactor Gitea and GitHub release workflows
|
|
||||||
- update version to 1.2.7 in platformio.ini; adjust Gitea release workflow
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.6] - 2025-02-18
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.6 in platformio.ini
|
|
||||||
- update version to 1.2.5; enhance Gitea release workflow and streamline release process
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- update changelog for version 1.2.5
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.5] - 2025-02-18
|
|
||||||
### Added
|
|
||||||
- update version to 1.2.5; enhance Gitea release workflow and streamline release process
|
|
||||||
|
|
||||||
|
|
||||||
## [1.2.4] - 2025-02-18
|
## [1.2.4] - 2025-02-18
|
||||||
### Added
|
### Added
|
||||||
- update version to 1.2.4 in HTML files and platformio.ini
|
- update version to 1.2.4 in HTML files and platformio.ini
|
||||||
|
18
README.md
18
README.md
@@ -124,24 +124,6 @@ german explanatory video: [Youtube](https://youtu.be/uNDe2wh9SS8?si=b-jYx4I1w62z
|
|||||||
- Configure WiFi settings through the captive portal.
|
- Configure WiFi settings through the captive portal.
|
||||||
- Access the web interface at `http://filaman.local` or the IP address.
|
- Access the web interface at `http://filaman.local` or the IP address.
|
||||||
|
|
||||||
## GitHub Actions Configuration
|
|
||||||
|
|
||||||
### Required Secrets for Gitea Releases
|
|
||||||
|
|
||||||
When using Gitea as your repository host, you need to configure the following secrets in your repository:
|
|
||||||
|
|
||||||
- `GITEA_API_URL`: The base URL of your Gitea instance, including protocol (e.g., `https://git.example.com`)
|
|
||||||
- `GITEA_TOKEN`: Your Gitea access token with permissions to create releases
|
|
||||||
- `GITEA_REPOSITORY`: The repository name in format `owner/repo` (e.g., `username/filaman`)
|
|
||||||
|
|
||||||
Example values:
|
|
||||||
```
|
|
||||||
GITEA_API_URL=https://git.example.com
|
|
||||||
GITEA_TOKEN=abcdef1234567890
|
|
||||||
GITEA_REPOSITORY=username/filaman
|
|
||||||
```
|
|
||||||
|
|
||||||
Make sure to set these secrets in your repository settings under Settings > Secrets and Variables > Actions.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.2.16"
|
version = "1.2.4"
|
||||||
|
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
Reference in New Issue
Block a user