-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 1.82 KB
/
update-binaries-esp32.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Download and Commit Release from ESPHome Repos
on:
workflow_dispatch: # Allows manual trigger of the workflow
inputs:
esphome_release_tag:
description: 'Tag of the ESPHome release firmware to download'
required: true
env:
esphome_repo: FutureProofHomes/Satellite1-ESPHome
xmos_repo: FutureProofHomes/Satellite1-XMOS
jobs:
download-release:
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v4
- name: Authenticate with GitHub CLI
run: |
echo "${{ secrets.PAT_TOKEN }}" | gh auth login --with-token
- name: Download ESPHome release asset
run: |
mkdir -p ./assets/firmware/esphome/${{ github.event.inputs.esphome_release_tag }}
gh release download ${{ github.event.inputs.esphome_release_tag }} \
--repo ${{ env.esphome_repo }} \
--dir ./assets/firmware/esphome/${{ github.event.inputs.esphome_release_tag }}
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: unzip the ESPHome release asset
run: |
cd ./assets/firmware/esphome/${{ github.event.inputs.esphome_release_tag }}
unzip *.zip
rm *.zip
tree
- name: Create manifest files for each hardware revision
run: |
chmod +x ./create_manifest.sh
./create_manifest.sh ${{ github.event.inputs.esphome_release_tag }} ${{ env.esphome_repo }}
- name: Add and commit release assets to the current repository
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email '[email protected]'
git add ./assets/*
git add ./manifests/*
git commit -m "Add ESPHome Firmware: ${{ github.event.inputs.esphome_release_tag }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}