Compare commits

..

2 Commits

6 changed files with 90 additions and 224 deletions

View File

@@ -1,21 +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 # 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
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,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
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
gh release create "${{ github.ref_name }}" \ cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
--title "Release ${{ inputs.version }}" \
--notes "${{ inputs.changelog }}" \ - name: Get version from tag
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \ id: get_version
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin" 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
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
run: |
# Create release using Gitea API
RESPONSE=$(curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-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
}')
# Extract release ID from response
RELEASE_ID=$(echo $RESPONSE | jq -r .id)
# Upload full firmware
curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/octet-stream" \
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_full.bin" \
--data-binary @.pio/build/esp32dev/filaman_full.bin
# Upload OTA firmware
curl -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/octet-stream" \
"${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_ota.bin" \
--data-binary @.pio/build/esp32dev/filaman_ota.bin

View File

@@ -1,4 +1,4 @@
name: Github Release name: GitHub Release
on: on:
push: push:

View File

@@ -1,85 +1,32 @@
name: Create Release name: Release
on: on:
push: push:
tags: tags:
- 'v*' - 'v*'
permissions:
contents: write # Required for creating releases
issues: read # Required for reading changelog
pull-requests: read # Required for reading changelog
jobs: jobs:
build: detect-and-run:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write # Required for creating releases at job level
steps: steps:
- uses: actions/checkout@v4 - name: Checkout code
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 - name: Determine hosting platform
run: | id: platform
# Use PlatformIO to create a proper OTA image run: |
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin if [[ "$GITHUB_SERVER_URL" == "https://github.com" ]]; then
echo "platform=github" >> $GITHUB_OUTPUT
- name: Get version from tag elif [[ "$CI_SERVER_URL" == *"gitlab"* ]]; then
id: get_version echo "platform=gitlab" >> $GITHUB_OUTPUT
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT else
echo "platform=gitea" >> $GITHUB_OUTPUT
- name: Read CHANGELOG.md fi
id: changelog
run: | - name: Run GitHub Release
CHANGELOG=$(awk "/## \\[${{ steps.get_version.outputs.VERSION }}\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md) if: steps.platform.outputs.platform == 'github'
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT uses: ./.github/workflows/providers/github-release.yml
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT - name: Run Gitea Release
if: steps.platform.outputs.platform == 'gitea'
- name: Install and Configure GitHub CLI uses: ./.github/workflows/providers/gitea-release.yml
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:
GH_TOKEN: ${{ secrets.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"

View File

@@ -1,111 +1,5 @@
# Changelog # Changelog
## [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
## [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

View File

@@ -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

View File

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