Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
5ff3864d9d | |||
9b8736d35f | |||
cf0ba20637 | |||
e06c0b9a76 | |||
4cb370ddff | |||
0b9c1711da | |||
e2449030c5 | |||
5a91e87afa | |||
5e66c3bd45 | |||
61c82f796f | |||
7661e0eb20 | |||
c06e6de89a | |||
262bed84df | |||
c710e5d7f8 | |||
5d39f04786 | |||
d955e26b82 | |||
c20e7de5c3 | |||
55c3b3688a | |||
fea5932125 | |||
04f557939d | |||
58549a53e4 | |||
64a46e3e7d |
74
.github/workflows/providers/gitea-release.yml
vendored
74
.github/workflows/providers/gitea-release.yml
vendored
@ -11,15 +11,11 @@ on:
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write # Required for creating releases
|
||||
issues: read # Required for reading changelog
|
||||
pull-requests: read # Required for reading changelog
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -32,8 +28,6 @@ jobs:
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio esptool
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y jq
|
||||
|
||||
- name: Build Firmware
|
||||
run: |
|
||||
@ -55,64 +49,12 @@ jobs:
|
||||
- name: Prepare OTA firmware
|
||||
run: cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
||||
|
||||
- name: Create Release
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
|
||||
GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Validate and sanitize API URL
|
||||
if [[ ! "$GITEA_API_URL" =~ ^https?:// ]]; then
|
||||
echo "Error: GITEA_API_URL must start with http:// or https://"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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..."
|
||||
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 @- << EOF
|
||||
{
|
||||
"tag_name": "${{ github.ref_name }}",
|
||||
"name": "Release ${{ inputs.version }}",
|
||||
"body": ${{ toJSON(inputs.changelog) }},
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
# 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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"
|
12
.github/workflows/providers/github-release.yml
vendored
12
.github/workflows/providers/github-release.yml
vendored
@ -11,15 +11,11 @@ on:
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write # Required for creating releases
|
||||
issues: read # Required for reading changelog
|
||||
pull-requests: read # Required for reading changelog
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # Required for creating releases at job level
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -35,8 +31,8 @@ jobs:
|
||||
|
||||
- name: Build Firmware
|
||||
run: |
|
||||
pio run -t buildfs # Build SPIFFS
|
||||
pio run # Build firmware
|
||||
pio run -t buildfs
|
||||
pio run
|
||||
|
||||
- name: Merge firmware and SPIFFS
|
||||
run: |
|
||||
@ -53,7 +49,7 @@ jobs:
|
||||
- name: Prepare OTA firmware
|
||||
run: cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_ota.bin
|
||||
|
||||
- name: Create Release
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
|
56
.github/workflows/release.yml
vendored
56
.github/workflows/release.yml
vendored
@ -7,51 +7,35 @@ on:
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: gitea-runner
|
||||
outputs:
|
||||
version: ${{ steps.get_version.outputs.VERSION }}
|
||||
changelog: ${{ steps.changelog.outputs.CHANGES }}
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get version from tag
|
||||
id: get_version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Verify version match
|
||||
id: version
|
||||
run: |
|
||||
PIO_VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
|
||||
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
if [ "$PIO_VERSION" != "$TAG_VERSION" ]; then
|
||||
echo "Error: Version mismatch between tag ($TAG_VERSION) and platformio.ini ($PIO_VERSION)"
|
||||
exit 1
|
||||
fi
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read CHANGELOG.md
|
||||
- name: Get changelog
|
||||
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: Determine provider
|
||||
id: detect-provider
|
||||
run: |
|
||||
if [[ "$GITHUB_SERVER_URL" == "https://github.com" ]]; then
|
||||
echo "provider=github" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "provider=gitea" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
release:
|
||||
needs: prepare
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run provider workflow
|
||||
uses: ./.github/workflows/providers/${{ needs.prepare.outputs.provider == 'github' && 'github' || 'gitea' }}-release.yml
|
||||
|
||||
- name: Run GitHub Release
|
||||
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
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||
|
||||
- name: Run Gitea Release
|
||||
if: github.server_url != 'https://gitlab.fire-devils.org'
|
||||
uses: ./.github/workflows/providers/gitea-release.yml
|
||||
with:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
changelog: ${{ steps.changelog.outputs.changelog }}
|
55
CHANGELOG.md
55
CHANGELOG.md
@ -1,5 +1,60 @@
|
||||
# Changelog
|
||||
|
||||
## [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
|
||||
|
@ -9,7 +9,7 @@
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[common]
|
||||
version = "1.2.12"
|
||||
version = "1.2.23"
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
|
Reference in New Issue
Block a user