-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (136 loc) · 5.35 KB
/
deploy.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Simple workflow for deploying static content to GitHub Pages
name: Build Tasmota and Deploy OTA
##
## TODO: Create a custom build of Tasmota, see below for more information:
## https://tasmota.github.io/docs/Compile-your-build/#customize-your-build
##
on:
# Runs on pushes targeting the default branch
push:
branches:
- master
# Build on a schedule once a week
schedule:
- cron: '0 0 * * mon'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build Tasmota
build:
name: Build Tasmota
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
# Set up the Tasmota variants to build
strategy:
matrix:
variant:
- tasmota
- tasmota-4M
- tasmota-display
- tasmota-ir
- tasmota-knx
- tasmota-lite
- tasmota-minimal
- tasmota-sensors
- tasmota-zbbridge
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
repository: arendst/Tasmota
# ref: development # Bleeding edge development code
ref: master # Stable release code
# fetch-depth: 1
- name: Setup Python
# if: success()
uses: actions/setup-python@v3
with:
python-version: '3.x' # '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
# architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install PlatformIO
# if: success()
run: |
# pip install -U platformio
# pio upgrade --dev
# pio pkg update --global
pip install wheel
pip install -U platformio
## TODO: Add a custom rule for a custom build, so we can do eg. battery charger auto-shutoff builds ootb (remember that we need things like SetOption21 too?!)
## https://tasmota.github.io/docs/Compile-your-build/#user_rule
- name: Customize Tasmota
if: ${{ matrix.variant == 'tasmota' || matrix.variant == 'tasmota32' }}
run: |-
# Create the configuration override file
touch tasmota/user_config_override.h
# Enable expression support
echo -e "#define USE_EXPRESSION // Add support for expression evaluation in rules (+3k2 code, +64 bytes mem)" >> tasmota/user_config_override.h
# Enable if statement support
echo -e "#define SUPPORT_IF_STATEMENT // Add support for IF statement in rules (+4k2 code, -332 bytes mem)" >> tasmota/user_config_override.h
# Disable Domoticz support
echo -e "#ifdef USE_DOMOTICZ" >> tasmota/user_config_override.h
echo -e "#undef USE_DOMOTICZ" >> tasmota/user_config_override.h
echo -e "#endif" >> tasmota/user_config_override.h
# Enable BH1750 support (ambient light sensor)
echo -e "#ifndef USE_BH1750" >> tasmota/user_config_override.h
echo -e "#define USE_BH1750 // [I2cDriver11] Enable BH1750 sensor (I2C address 0x23 or 0x5C) (+0k5 code)" >> tasmota/user_config_override.h
echo -e "#endif" >> tasmota/user_config_override.h
# Enable LD2410 support (24GHz mmWave presence/person detector)
echo -e "#ifndef USE_LD2410" >> tasmota/user_config_override.h
echo -e "#define USE_LD2410" >> tasmota/user_config_override.h
echo -e "#endif" >> tasmota/user_config_override.h
- name: Build Tasmota
run: platformio run -e ${{ matrix.variant }}
- name: Upload Build Files
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: tasmota
path: build_output/firmware
# Deploy Tasmota binaries to OTA update website
deploy:
name: Deploy OTA
runs-on: ubuntu-latest
needs: build
timeout-minutes: 5
continue-on-error: true
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup GitHub Pages
uses: actions/configure-pages@v2
- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: tasmota
path: public/firmware
## FIXME: While this is technically fine, customize the page a bit, especially the title (which incorrectly cites the path)
- name: Generate Directory Listing
uses: jayanta525/[email protected]
with:
FOLDER: public/firmware
- name: Upload Files to GitHub Pages
uses: actions/upload-pages-artifact@v1
with:
# path: public
path: public/firmware
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1