Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
0c4bae48d4 | |||
b4b17cb999 | |||
5ff3864d9d | |||
9b8736d35f | |||
cf0ba20637 | |||
e06c0b9a76 | |||
4cb370ddff | |||
0b9c1711da | |||
e2449030c5 | |||
5a91e87afa | |||
5e66c3bd45 | |||
61c82f796f | |||
7661e0eb20 | |||
c06e6de89a | |||
262bed84df | |||
c710e5d7f8 |
58
.github/workflows/providers/gitea-release.yml
vendored
58
.github/workflows/providers/gitea-release.yml
vendored
@ -12,8 +12,6 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
issues: read
|
|
||||||
pull-requests: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -30,8 +28,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install --upgrade platformio esptool
|
pip install --upgrade platformio esptool
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y jq
|
|
||||||
|
|
||||||
- name: Build Firmware
|
- name: Build Firmware
|
||||||
run: |
|
run: |
|
||||||
@ -53,52 +49,12 @@ jobs:
|
|||||||
- 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: Create Release
|
- name: Create GitHub Release
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
|
|
||||||
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
|
|
||||||
run: |
|
run: |
|
||||||
# Validate and sanitize API URL
|
gh release create "${{ github.ref_name }}" \
|
||||||
if [[ ! "$GITEA_API_URL" =~ ^https?:// ]]; then
|
--title "Release ${{ inputs.version }}" \
|
||||||
echo "Error: GITEA_API_URL must start with http:// or https://"
|
--notes "${{ inputs.changelog }}" \
|
||||||
exit 1
|
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
||||||
fi
|
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
||||||
|
|
||||||
# Remove trailing slash and ensure /api/v1
|
|
||||||
GITEA_API_URL="${GITEA_API_URL%/}"
|
|
||||||
if [[ ! "$GITEA_API_URL" =~ /api/v1$ ]]; then
|
|
||||||
GITEA_API_URL="${GITEA_API_URL}/api/v1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Creating Gitea release..."
|
|
||||||
release_data="{\"tag_name\":\"${{ github.ref_name }}\",\"name\":\"Release ${{ inputs.version }}\",\"body\":${{ toJSON(inputs.changelog) }},\"draft\":false,\"prerelease\":false}"
|
|
||||||
RESPONSE=$(curl -sS -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-H "Accept: application/json" \
|
|
||||||
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases" \
|
|
||||||
-d "$release_data")
|
|
||||||
|
|
||||||
# Extract and validate release ID
|
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r .id)
|
|
||||||
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
|
|
||||||
echo "Error: Failed to get release ID"
|
|
||||||
echo "API Response:"
|
|
||||||
echo "$RESPONSE" | jq .
|
|
||||||
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
|
|
101
.github/workflows/release.yml
vendored
101
.github/workflows/release.yml
vendored
@ -1,55 +1,60 @@
|
|||||||
name: Release
|
name: GitHub Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_call:
|
||||||
tags:
|
inputs:
|
||||||
- 'v*'
|
version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
changelog:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-version-and-changelog:
|
build:
|
||||||
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
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get version from tag
|
- name: Set up Python
|
||||||
id: get_version
|
uses: actions/setup-python@v4
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
- name: Verify version match
|
|
||||||
run: |
|
- name: Install dependencies
|
||||||
PIO_VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
|
run: |
|
||||||
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
|
python -m pip install --upgrade pip
|
||||||
|
pip install --upgrade platformio esptool
|
||||||
if [ "$PIO_VERSION" != "$TAG_VERSION" ]; then
|
|
||||||
echo "Error: Version mismatch between tag ($TAG_VERSION) and platformio.ini ($PIO_VERSION)"
|
- name: Build Firmware
|
||||||
exit 1
|
run: |
|
||||||
fi
|
pio run -t buildfs
|
||||||
|
pio run
|
||||||
- name: Read CHANGELOG.md
|
|
||||||
id: changelog
|
- name: Merge firmware and SPIFFS
|
||||||
run: |
|
run: |
|
||||||
CHANGELOG=$(awk "/## \\[${{ steps.get_version.outputs.VERSION }}\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
|
esptool.py --chip esp32 merge_bin \
|
||||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
--flash_mode dio \
|
||||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
--flash_freq 40m \
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
--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
|
||||||
|
|
||||||
github-release:
|
- name: Prepare OTA firmware
|
||||||
needs: get-version-and-changelog
|
run: cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
||||||
if: github.server_url == 'https://github.com'
|
|
||||||
uses: ./.github/workflows/providers/github-release.yml
|
- name: Create GitHub Release
|
||||||
with:
|
env:
|
||||||
version: ${{ needs.get-version-and-changelog.outputs.version }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
changelog: ${{ needs.get-version-and-changelog.outputs.changelog }}
|
run: |
|
||||||
secrets: inherit
|
gh release create "${{ github.ref_name }}" \
|
||||||
|
--title "Release ${{ inputs.version }}" \
|
||||||
gitea-release:
|
--notes "${{ inputs.changelog }}" \
|
||||||
needs: get-version-and-changelog
|
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
||||||
if: github.server_url != 'https://github.com'
|
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
||||||
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
|
|
40
CHANGELOG.md
40
CHANGELOG.md
@ -1,5 +1,45 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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
|
||||||
|
|
||||||
|
|
||||||
## [1.2.16] - 2025-02-19
|
## [1.2.16] - 2025-02-19
|
||||||
### Added
|
### Added
|
||||||
- update Gitea release workflow and increment version to 1.2.16
|
- update Gitea release workflow and increment version to 1.2.16
|
||||||
|
@ -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.24"
|
||||||
|
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
Reference in New Issue
Block a user