Compare commits

...

22 Commits

Author SHA1 Message Date
7a4b1a934f docs: update changelog for version 1.2.28
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) Successful in 2m42s
2025-02-19 10:24:47 +01:00
77d90bbe83 feat: add build and release workflows for Gitea and GitHub, increment version to 1.2.28 2025-02-19 10:24:43 +01:00
c99d802184 docs: update changelog for version 1.2.27
Some checks failed
Release Workflow / route (push) Successful in 7s
Release Workflow / verify-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Failing after 2m49s
2025-02-19 10:12:55 +01:00
ca15d2abe4 feat: enhance CI workflows with provider detection and update version to 1.2.27 2025-02-19 10:12:52 +01:00
bddb48ba9a docs: update changelog for version 1.2.26
Some checks failed
Release Workflow / route (push) Successful in 15s
Release Workflow / gitea-release (push) Has been cancelled
Release Workflow / github-release (push) Has been cancelled
2025-02-19 10:07:45 +01:00
f4b67e52b8 feat: update release workflows for Gitea and GitHub, increment version to 1.2.26 2025-02-19 10:07:41 +01:00
00f6a4b0ae docs: update changelog for version 1.2.25
Some checks failed
Github Release / build (push) Failing after 3m8s
Create Release / build (push) Has been cancelled
2025-02-19 09:43:47 +01:00
ab3937a69d feat: update GitHub release workflows and increment version to 1.2.25 2025-02-19 09:43:44 +01:00
0c4bae48d4 docs: update changelog for version 1.2.24 2025-02-19 09:40:33 +01:00
b4b17cb999 feat: update GitHub release workflow and increment version to 1.2.24 2025-02-19 09:40:30 +01:00
5ff3864d9d docs: update changelog for version 1.2.23
Some checks failed
Release / prepare (push) Has been cancelled
2025-02-19 09:39:43 +01:00
9b8736d35f feat: update Gitea release workflow and increment version to 1.2.23 2025-02-19 09:39:41 +01:00
cf0ba20637 docs: update changelog for version 1.2.22
Some checks failed
Release / prepare (push) Has been cancelled
2025-02-19 09:27:21 +01:00
e06c0b9a76 feat: update Gitea runner configuration and increment version to 1.2.22 2025-02-19 09:27:18 +01:00
4cb370ddff docs: update changelog for version 1.2.21
Some checks failed
Release / prepare (push) Has been cancelled
2025-02-19 01:30:59 +01:00
0b9c1711da feat: update Gitea release condition and increment version to 1.2.21 2025-02-19 01:30:46 +01:00
e2449030c5 docs: update changelog for version 1.2.20
Some checks failed
Release / prepare (push) Has been cancelled
2025-02-19 01:21:23 +01:00
5a91e87afa feat: update release workflows for GitHub and Gitea, increment version to 1.2.20 2025-02-19 01:21:14 +01:00
5e66c3bd45 docs: update changelog for version 1.2.19
Some checks failed
Release / prepare (push) Has been cancelled
Release / github (push) Has been cancelled
Release / gitea (push) Has been cancelled
2025-02-19 01:19:46 +01:00
61c82f796f feat: add Gitea and GitHub release workflows for version 1.2.19 2025-02-19 01:19:42 +01:00
7661e0eb20 docs: update changelog for version 1.2.18
Some checks failed
Release / release (push) Has been cancelled
2025-02-19 01:18:00 +01:00
c06e6de89a feat: remove Gitea and GitHub release workflows and increment version to 1.2.18 2025-02-19 01:17:56 +01:00
6 changed files with 291 additions and 181 deletions

87
.github/workflows/providers/build.yml vendored Normal file
View 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

View File

@ -2,62 +2,88 @@ name: Gitea Release
on:
workflow_call:
inputs:
version:
type: string
required: true
changelog:
type: string
required: true
jobs:
release:
runs-on: gitea-runner
build:
uses: ./.github/workflows/providers/build.yml
create-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Debug Info
run: |
echo "Version: ${{ inputs.version }}"
echo "Changelog: ${{ inputs.changelog }}"
echo "Tag: ${GITHUB_REF#refs/tags/}"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio esptool
- name: Build
run: |
pio run -t buildfs
pio run
- name: Create full firmware
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
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
- name: Create Release
run: |
TAG="${GITHUB_REF#refs/tags/}"
curl -X POST "${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases" \
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: firmware
path: firmware
- name: Create Gitea Release
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
# Determine API URL if not set
API_URL="${GITEA_API_URL:-${GITEA_SERVER_URL}/api/v1}"
REPO="${GITEA_REPOSITORY}"
TAG="${GITEA_REF_NAME}"
if [ -z "$API_URL" ] || [ -z "$REPO" ] || [ -z "$TAG" ]; then
echo "Error: Required Gitea environment variables are not set"
env
exit 1
fi
# Escape changelog content for JSON
CHANGELOG_ESCAPED=$(echo '${{ needs.build.outputs.changelog }}' | jq -sR .)
echo "Creating release for tag: $TAG"
echo "Using API URL: $API_URL"
echo "Repository: $REPO"
# Create release using Gitea API
RELEASE_DATA=$(cat <<EOF
{
"tag_name": "$TAG",
"name": "Release ${{ needs.build.outputs.version }}",
"body": ${CHANGELOG_ESCAPED}
}
EOF
)
echo "Release data:"
echo "$RELEASE_DATA" | jq '.'
# Create the release
RELEASE_ID=$(curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "$RELEASE_DATA" \
"${API_URL}/repos/${REPO}/releases" \
| tee /dev/stderr \
| jq -r '.id')
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
echo "Failed to create release"
exit 1
fi
echo "Created release with ID: $RELEASE_ID"
# Upload the binary files
for file in "filaman_full.bin" "filaman_ota.bin"; do
echo "Uploading $file..."
RESPONSE=$(curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"Release ${{ inputs.version }}\",\"body\":\"${{ inputs.changelog }}\",\"draft\":false,\"prerelease\":false}"
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
-H "Content-Type: application/octet-stream" \
--data-binary @"firmware/$file" \
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file")
if echo "$RESPONSE" | jq -e '.id' > /dev/null; then
echo "Successfully uploaded $file"
else
echo "Failed to upload $file"
echo "Response: $RESPONSE"
exit 1
fi
done

View File

@ -2,59 +2,29 @@ name: GitHub Release
on:
workflow_call:
inputs:
version:
required: true
type: string
changelog:
required: true
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio esptool
- name: Build Firmware
run: |
pio run -t buildfs
pio run
- 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
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: Prepare OTA firmware
run: cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
--title "Release ${{ inputs.version }}" \
--notes "${{ inputs.changelog }}" \
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
--title "Release ${{ needs.build.outputs.version }}" \
--notes "${{ needs.build.outputs.changelog }}" \
firmware/filaman_full.bin \
firmware/filaman_ota.bin

View File

@ -1,4 +1,4 @@
name: Release
name: Release Workflow
on:
push:
@ -6,86 +6,58 @@ on:
- 'v*'
jobs:
prepare:
runs-on: gitea-runner
route:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
changelog: ${{ steps.changelog.outputs.changelog }}
provider: ${{ steps.provider.outputs.provider }}
steps:
- uses: actions/checkout@v4
- name: Get version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Get changelog
id: changelog
run: |
CHANGELOG=$(awk "/## \\[${{ steps.version.outputs.version }}\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Checkout Repository
uses: actions/checkout@v3
github:
needs: prepare
if: github.server_url == 'https://github.com'
uses: ./.github/workflows/providers/github-release.yml
with:
version: ${{ needs.prepare.outputs.version }}
changelog: ${{ needs.prepare.outputs.changelog }}
secrets: inherit
- name: Debug Environment
run: |
echo "CI Environment Details:"
echo "GITHUB_ACTIONS=${GITHUB_ACTIONS:-not set}"
echo "GITEA_ACTIONS=${GITEA_ACTIONS:-not set}"
echo "GITEA_REPOSITORY=${GITEA_REPOSITORY:-not set}"
echo "RUNNER_NAME=${RUNNER_NAME:-not set}"
gitea:
needs: prepare
if: github.server_url != 'https://github.com'
runs-on: gitea-runner
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
- name: Determine CI Provider
id: provider
shell: bash
run: |
python -m pip install --upgrade pip
pip install platformio esptool
- name: Build
run: |
pio run -t buildfs
pio run
# Initialize provider as unknown
PROVIDER="unknown"
- name: Create full firmware
# Check for Gitea specific environment first
if [ -n "${GITEA_ACTIONS}" ] || [ -n "${GITEA_REPOSITORY}" ] || [[ "${RUNNER_NAME}" == *"gitea"* ]]; then
PROVIDER="gitea"
# Then check for GitHub
elif [ "${GITHUB_ACTIONS}" = "true" ]; then
PROVIDER="github"
fi
echo "Detected provider: ${PROVIDER}"
echo "provider=${PROVIDER}" >> "${GITHUB_OUTPUT}"
verify-provider:
needs: route
runs-on: ubuntu-latest
steps:
- name: Echo detected provider
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
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
- name: Create Release
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
run: |
echo "Creating release for version ${{ needs.prepare.outputs.version }}"
curl -X POST "${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"${GITHUB_REF#refs/tags/}\",
\"name\": \"Release ${{ needs.prepare.outputs.version }}\",
\"body\": \"${{ needs.prepare.outputs.changelog }}\",
\"draft\": false,
\"prerelease\": false
}"
echo "Detected CI Provider: ${{ needs.route.outputs.provider }}"
if [ "${{ needs.route.outputs.provider }}" = "unknown" ]; then
echo "::error::Failed to detect CI provider!"
exit 1
fi
github-release:
needs: [route, verify-provider]
if: needs.route.outputs.provider == 'github'
uses: ./.github/workflows/providers/github-release.yml
gitea-release:
needs: [route, verify-provider]
if: needs.route.outputs.provider == 'gitea'
uses: ./.github/workflows/providers/gitea-release.yml

View File

@ -1,5 +1,60 @@
# Changelog
## [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
## [1.2.26] - 2025-02-19
### Added
- update release workflows for Gitea and GitHub, increment version to 1.2.26
## [1.2.25] - 2025-02-19
### Added
- update GitHub release workflows and increment version to 1.2.25
## [1.2.24] - 2025-02-19
### Added
- update GitHub release workflow and increment version to 1.2.24
## [1.2.23] - 2025-02-19
### Added
- update Gitea release workflow and increment version to 1.2.23
## [1.2.22] - 2025-02-19
### Added
- update Gitea runner configuration and increment version to 1.2.22
## [1.2.21] - 2025-02-19
### Added
- update Gitea release condition and increment version to 1.2.21
## [1.2.20] - 2025-02-19
### Added
- update release workflows for GitHub and Gitea, increment version to 1.2.20
## [1.2.19] - 2025-02-19
### Added
- add Gitea and GitHub release workflows for version 1.2.19
## [1.2.18] - 2025-02-19
### Added
- remove Gitea and GitHub release workflows and increment version to 1.2.18
## [1.2.17] - 2025-02-19
### Added
- update Gitea release workflow for version 1.2.17 and improve job structure

View File

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