Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
bddb48ba9a | |||
f4b67e52b8 | |||
00f6a4b0ae | |||
ab3937a69d | |||
0c4bae48d4 | |||
b4b17cb999 | |||
5ff3864d9d | |||
9b8736d35f | |||
cf0ba20637 | |||
e06c0b9a76 | |||
4cb370ddff | |||
0b9c1711da | |||
e2449030c5 | |||
5a91e87afa | |||
5e66c3bd45 | |||
61c82f796f |
80
.github/workflows/providers/gitea-release.yml
vendored
Normal file
80
.github/workflows/providers/gitea-release.yml
vendored
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
name: Gitea Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call: # This ensures the workflow can only be called from another workflow
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # Required for creating releases
|
||||||
|
issues: read # Required for reading changelog
|
||||||
|
pull-requests: read # Required for reading changelog
|
||||||
|
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: |
|
||||||
|
# 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
|
||||||
|
|
||||||
|
- 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:
|
||||||
|
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"
|
83
.github/workflows/providers/github-release.yml
vendored
Normal file
83
.github/workflows/providers/github-release.yml
vendored
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # Required for creating releases at job level
|
||||||
|
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: |
|
||||||
|
# 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
|
||||||
|
|
||||||
|
- 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:
|
||||||
|
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"
|
124
.github/workflows/release.yml
vendored
124
.github/workflows/release.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Release
|
name: Release Workflow
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -6,105 +6,31 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
route:
|
||||||
runs-on: gitea-runner
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
provider: ${{ steps.provider.outputs.provider }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: Debug Environment
|
|
||||||
|
- name: Determine CI Provider
|
||||||
|
id: provider
|
||||||
run: |
|
run: |
|
||||||
echo "GITHUB_REF: $GITHUB_REF"
|
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
||||||
echo "GITHUB_SHA: $GITHUB_SHA"
|
echo "provider=github" >> $GITHUB_OUTPUT
|
||||||
echo "PWD: $PWD"
|
elif [[ "$GITEA_ACTIONS" == "true" ]]; then
|
||||||
ls -la
|
echo "provider=gitea" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get version from tag
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/v}
|
|
||||||
echo "Raw version: ${VERSION}"
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Get changelog
|
|
||||||
id: changelog
|
|
||||||
run: |
|
|
||||||
echo "Reading changelog for version ${{ steps.version.outputs.version }}"
|
|
||||||
if [ ! -f "CHANGELOG.md" ]; then
|
|
||||||
echo "Error: CHANGELOG.md not found"
|
|
||||||
ls -la
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
CHANGELOG=$(awk "/## \\[${{ steps.version.outputs.version }}\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
|
|
||||||
if [ -z "$CHANGELOG" ]; then
|
|
||||||
echo "Warning: No changelog entry found for version ${{ steps.version.outputs.version }}"
|
|
||||||
echo "File content:"
|
|
||||||
cat CHANGELOG.md
|
|
||||||
else
|
else
|
||||||
echo "Found changelog entry:"
|
echo "provider=unknown" >> $GITHUB_OUTPUT
|
||||||
echo "$CHANGELOG"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{
|
github-release:
|
||||||
echo "changelog<<EOF"
|
needs: route
|
||||||
echo "$CHANGELOG"
|
if: needs.route.outputs.provider == 'github'
|
||||||
echo "EOF"
|
uses: ./.github/workflows/providers/github-release.yml
|
||||||
} >> $GITHUB_OUTPUT
|
|
||||||
|
gitea-release:
|
||||||
- name: Set up Python
|
needs: route
|
||||||
uses: actions/setup-python@v4
|
if: needs.route.outputs.provider == 'gitea'
|
||||||
with:
|
uses: ./.github/workflows/providers/gitea-release.yml
|
||||||
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 Gitea Release
|
|
||||||
if: github.server_url != 'https://github.com'
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
|
|
||||||
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
|
|
||||||
run: |
|
|
||||||
echo "Creating Gitea release for version ${{ steps.version.outputs.version }}"
|
|
||||||
curl -v -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 ${{ steps.version.outputs.version }}\",
|
|
||||||
\"body\": \"${{ steps.changelog.outputs.changelog }}\",
|
|
||||||
\"draft\": false,
|
|
||||||
\"prerelease\": false
|
|
||||||
}"
|
|
||||||
|
|
||||||
- name: Create GitHub Release
|
|
||||||
if: github.server_url == 'https://github.com'
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
gh release create "${{ github.ref_name }}" \
|
|
||||||
--title "Release ${{ steps.version.outputs.version }}" \
|
|
||||||
--notes "${{ steps.changelog.outputs.changelog }}" \
|
|
||||||
".pio/build/esp32dev/filaman_full.bin#filaman_full.bin" \
|
|
||||||
".pio/build/esp32dev/filaman_ota.bin#filaman_ota.bin"
|
|
40
CHANGELOG.md
40
CHANGELOG.md
@ -1,5 +1,45 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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
|
## [1.2.18] - 2025-02-19
|
||||||
### Added
|
### Added
|
||||||
- remove Gitea and GitHub release workflows and increment version to 1.2.18
|
- remove Gitea and GitHub release workflows and increment version to 1.2.18
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
version = "1.2.18"
|
version = "1.2.26"
|
||||||
|
|
||||||
[env:esp32dev]
|
[env:esp32dev]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
Reference in New Issue
Block a user