Skip to content

Commit 39bf872

Browse files
authored
Add files via upload
1 parent 2872bf6 commit 39bf872

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/check-update.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Check for ESP-Hosted Updates
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * *' # Daily at 6 AM UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get latest ESP-Hosted version
13+
id: latest
14+
run: |
15+
VERSION=$(curl -s "https://components.espressif.com/api/components/espressif/esp_hosted" | jq -r '.versions[0].version')
16+
echo "version=$VERSION" >> $GITHUB_OUTPUT
17+
echo "Latest ESP-Hosted version: $VERSION"
18+
19+
- name: Get latest release version
20+
id: current
21+
env:
22+
GH_TOKEN: ${{ github.token }}
23+
run: |
24+
VERSION=$(gh release view --repo ${{ github.repository }} --json tagName -q '.tagName' 2>/dev/null | sed 's/^v//' || echo "none")
25+
echo "version=$VERSION" >> $GITHUB_OUTPUT
26+
echo "Current release version: $VERSION"
27+
28+
- name: Trigger build if new version
29+
if: steps.latest.outputs.version != steps.current.outputs.version
30+
env:
31+
GH_TOKEN: ${{ github.token }}
32+
run: |
33+
echo "New version available: ${{ steps.latest.outputs.version }}"
34+
gh workflow run build.yml --repo ${{ github.repository }} -f version=${{ steps.latest.outputs.version }} -f release=true

0 commit comments

Comments
 (0)