Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ESP32C5/sdkconfig* text eol=lf
12 changes: 12 additions & 0 deletions .github/scripts/container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ Options:
EOF
}

normalize_sdkconfig() {
local cfg="${APP_DIR}/sdkconfig"
local cfg_old="${APP_DIR}/sdkconfig.old"

for f in "$cfg" "$cfg_old"; do
[ -f "$f" ] || continue
sed -i 's/\r$//' "$f"
done
}

while [[ $# -gt 0 ]]; do
case "$1" in
--no-docker)
Expand All @@ -42,6 +52,7 @@ done

build_native() {
cd "$APP_DIR"
normalize_sdkconfig
export IDF_TARGET=esp32c5
if [ -f /opt/esp/idf/export.sh ]; then
# shellcheck disable=SC1091
Expand All @@ -60,6 +71,7 @@ if [[ "$USE_DOCKER" == "0" || "$USE_DOCKER" == "false" ]]; then
fi

mkdir -p "$CACHE_DIR"
normalize_sdkconfig

docker run --rm \
--workdir /project \
Expand Down
111 changes: 103 additions & 8 deletions .github/workflows/esp32c5-build-master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ESP32C5 Build (IDF 6.0-dev)
name: ESP32C5 Build (IDF 6.0-beta1)

on:
workflow_dispatch:
Expand All @@ -7,23 +7,53 @@ on:
description: "Optional tag name to upload assets to a release (example 'v1.2.3')"
required: false
push:
branches: [main, master]
branches: [main]
paths:
- 'ESP32C5/main/main.c'
- 'FLIPPER/**'
- '.github/scripts/**'
- '.github/workflows/esp32c5-build-master.yml'
release:
types: [published, edited]

jobs:
changes:
name: Detect workflow changes
runs-on: ubuntu-24.04
outputs:
workflow_changed: ${{ steps.filter.outputs.workflow_changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check workflow diff
id: filter
run: |
set -euo pipefail
if [ "${GITHUB_EVENT_NAME:-}" != "push" ]; then
echo "workflow_changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi

base="${{ github.event.before }}"
head="${{ github.sha }}"
if [ -z "$base" ] || [ "$base" = "0000000000000000000000000000000000000000" ]; then
base="$(git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD)"
fi

if git diff --name-only "$base" "$head" | grep -qE '^\.github/workflows/'; then
echo "workflow_changed=true" >> "$GITHUB_OUTPUT"
else
echo "workflow_changed=false" >> "$GITHUB_OUTPUT"
fi

firmware:
name: JanOS
permissions:
contents: write
runs-on: ubuntu-24.04
container:
image: espressif/idf:v6.0-dev
image: espressif/idf:v6.0-beta1
outputs:
fw_version: ${{ steps.version.outputs.version }}
steps:
Expand Down Expand Up @@ -151,9 +181,12 @@ jobs:

release:
name: Release
needs: [firmware, fap]
needs: [changes, firmware, fap]
runs-on: ubuntu-24.04
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '')
permissions:
contents: write
pull-requests: read
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '')) && needs.changes.outputs.workflow_changed != 'true'
steps:
- name: Download JanOS artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -209,11 +242,73 @@ jobs:
out="bundle/projectZero-${FW_VERSION}-with-fap-${FAP_VERSION:-unknown}.zip"
zip -9 "$out" "${files[@]}"

- name: Upload binaries to GitHub Release
- name: Build release notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FW_VERSION: ${{ needs.firmware.outputs.fw_version }}
FAP_VERSION: ${{ needs.fap.outputs.fap_version }}
REPO: ${{ github.repository }}
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.release_tag || format('v{0}', needs.firmware.outputs.fw_version) }}
run: |
set -euo pipefail
notes_file="release_notes.md"
TAG="${RELEASE_TAG:-$FW_VERSION}"
FAP_VER="${FAP_VERSION:-unknown}"
BASE_URL="https://github.com/$REPO/releases/download/$TAG"
JANOS_ZIP="$BASE_URL/projectZero-${FW_VERSION}.zip"
FAP_ZIP="$BASE_URL/projectZero-faps-${FAP_VER}.zip"
BUNDLE_ZIP="$BASE_URL/projectZero-${FW_VERSION}-with-fap-${FAP_VER}.zip"
RELEASE_PAGE="https://github.com/$REPO/releases/tag/$TAG"
PAGES_LINK="https://${REPO%/*}.github.io/${REPO#*/}/"

{
printf '%s\n\n' "Release ${TAG} published."
printf '%s\n' "Release page: ${RELEASE_PAGE}"
printf '%s\n' "Web flasher: ${PAGES_LINK}"
printf '%s\n' "JanOS (${FW_VERSION}): ${JANOS_ZIP}"
printf '%s\n' "FAPs (${FAP_VER}): ${FAP_ZIP}"
printf '%s\n\n' "Full package: ${BUNDLE_ZIP}"
} > "$notes_file"

if [ "${GITHUB_EVENT_NAME:-}" = "release" ]; then
if [ -n "${GITHUB_EVENT_PATH:-}" ] && [ -f "${GITHUB_EVENT_PATH:-}" ]; then
release_body="$(jq -r '.release.body // ""' "$GITHUB_EVENT_PATH")"
if [ -n "$(printf '%s' "$release_body" | tr -d '\r\n[:space:]')" ]; then
printf '%s\n' "$release_body" >> "$notes_file"
fi
fi
exit 0
fi

if command -v gh >/dev/null 2>&1; then
api="/repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/pulls"
pr_json="$(gh api -H "Accept: application/vnd.github+json" "$api" 2>/dev/null || echo '[]')"
pr_title="$(printf '%s' "$pr_json" | jq -r '.[0].title // ""')"
pr_body="$(printf '%s' "$pr_json" | jq -r '.[0].body // ""')"

if [ -n "$(printf '%s' "$pr_body" | tr -d '\r\n[:space:]')" ]; then
if [ -n "$pr_title" ]; then
printf '%s\n\n' "$pr_title" >> "$notes_file"
fi
printf '%s\n' "$pr_body" >> "$notes_file"
exit 0
fi

gen_json="$(gh api -X POST -H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
-f tag_name="$TAG" -f target_commitish="$GITHUB_SHA" 2>/dev/null || echo '')"
gen_body="$(printf '%s' "$gen_json" | jq -r '.body // ""')"
if [ -n "$(printf '%s' "$gen_body" | tr -d '\r\n[:space:]')" ]; then
printf '%s\n' "$gen_body" >> "$notes_file"
fi
fi

- name: Upload binaries to GitHub Release (notes)
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.release.tag_name || inputs.release_tag || format('v{0}', needs.firmware.outputs.fw_version) }}
name: ${{ format('projectZero {0}', needs.firmware.outputs.fw_version) }}
body_path: release_notes.md
files: |
release_artifacts/firmware/bootloader.bin
release_artifacts/firmware/partition-table.bin
Expand Down
Binary file removed ESP32C5/.DS_Store
Binary file not shown.
Binary file modified ESP32C5/binaries-esp32c5/bootloader.bin
Binary file not shown.
Binary file modified ESP32C5/binaries-esp32c5/projectZero.bin
Binary file not shown.
3 changes: 1 addition & 2 deletions ESP32C5/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3243,8 +3243,7 @@ CONFIG_IEEE802154_CCA_ED=y
# CONFIG_IEEE802154_CCA_CARRIER_AND_ED is not set
# default:
CONFIG_IEEE802154_CCA_MODE=1
# default:
CONFIG_IEEE802154_CCA_THRESHOLD=-75
CONFIG_IEEE802154_CCA_THRESHOLD=-65
# default:
CONFIG_IEEE802154_PENDING_TABLE_SIZE=20
# default:
Expand Down
Loading