diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index 537bc548..c4054cea 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -56,51 +56,12 @@ jobs:
- name: "Build environment: ${{ matrix.envname }}"
run: pio run -e ${{ matrix.envname }}
- build-and-publish-installer:
- if: ( github.repository_owner == 'PlummersSoftwareLLC' && github.ref == 'refs/heads/main' ) || ( github.repository_owner == 'rbergen' && github.ref == 'refs/heads/staging' )
-
- runs-on: ubuntu-latest
+ call-web-installer:
+ if: ( github.repository_owner == 'rbergen' && github.ref == 'refs/heads/staging' )
needs: [build-environment]
- env:
- PLATFORMIO_CORE_DIR: ${{ github.workspace }}/.platformio
-
- steps:
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.11'
-
- - name: Maximize build space
- uses: easimon/maximize-build-space@master
- with:
- remove-android: 'true'
- remove-codeql: 'true'
- remove-docker-images: 'true'
- remove-dotnet: 'true'
- remove-haskell: 'true'
-
- - uses: actions/checkout@v4
-
- - name: Install PlatformIO
- run: |
- curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
- python get-platformio.py
- echo "${PLATFORMIO_CORE_DIR}/penv/bin" >> $GITHUB_PATH
-
- - name: Copy secrets and clear SSID
- run: |
- grep -v "^#define cszSSID" include/secrets.example.h > include/secrets.h
- echo '#define cszSSID ""' >> include/secrets.h
-
- - name: Build web installer environments and installer
- run: |
- python tools/bake_installer.py
- touch WebInstaller/.nojekyll
-
- - name: Push to GitHub Pages
- uses: JamesIves/github-pages-deploy-action@v4
- with:
- branch: pages
- folder: WebInstaller
+ uses: ./.github/workflows/web_installer.yml
+ with:
+ release-name: ${{ github.ref_name }} commit ${{ github.sha }}
+ secrets: inherit
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..d9f9f03b
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,12 @@
+name: Release actions
+
+on:
+ release:
+ types: [published]
+
+jobs:
+ call-web-installer:
+ uses: ./.github/workflows/web_installer.yml
+ with:
+ release-name: ${{ github.event.release.name }}
+ secrets: inherit
\ No newline at end of file
diff --git a/.github/workflows/web_installer.yml b/.github/workflows/web_installer.yml
new file mode 100644
index 00000000..09cd4d1b
--- /dev/null
+++ b/.github/workflows/web_installer.yml
@@ -0,0 +1,55 @@
+name: Web Installer build and deploy
+
+on:
+ workflow_call:
+ inputs:
+ release-name:
+ description: 'Name of the Web Installer release'
+ required: true
+ type: string
+
+jobs:
+ build-and-publish-installer:
+ runs-on: ubuntu-latest
+
+ env:
+ PLATFORMIO_CORE_DIR: ${{ github.workspace }}/.platformio
+
+ steps:
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Maximize build space
+ uses: easimon/maximize-build-space@master
+ with:
+ remove-android: 'true'
+ remove-codeql: 'true'
+ remove-docker-images: 'true'
+ remove-dotnet: 'true'
+ remove-haskell: 'true'
+
+ - uses: actions/checkout@v4
+
+ - name: Install PlatformIO
+ run: |
+ curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
+ python get-platformio.py
+ echo "${PLATFORMIO_CORE_DIR}/penv/bin" >> $GITHUB_PATH
+
+ - name: Copy secrets and clear SSID
+ run: |
+ grep -v "^#define cszSSID" include/secrets.example.h > include/secrets.h
+ echo '#define cszSSID ""' >> include/secrets.h
+
+ - name: Build web installer environments and installer
+ run: |
+ python tools/bake_installer.py '${{ inputs.release-name }}'
+ touch WebInstaller/.nojekyll
+
+ - name: Push to GitHub Pages
+ uses: JamesIves/github-pages-deploy-action@v4
+ with:
+ branch: pages
+ folder: WebInstaller
diff --git a/config/installer_index.html b/config/installer_index.html
index 33f1b902..9ef4c55e 100644
--- a/config/installer_index.html
+++ b/config/installer_index.html
@@ -55,6 +55,11 @@
NightDriverLED ESP32 Installation Wizard
+
+
Release: $$RELEASE_NAME$$
+
+
+
Select your device type:
diff --git a/tools/bake_installer.py b/tools/bake_installer.py
index 9367a0ee..51cd9f30 100755
--- a/tools/bake_installer.py
+++ b/tools/bake_installer.py
@@ -35,6 +35,7 @@
import json
import shutil
import subprocess
+import sys
import show_features
class Dirs:
@@ -57,6 +58,7 @@ class Manifest:
globals_h = 'globals.h'
index_template_file = 'installer_index.html'
index_file = 'index.html'
+release_name = sys.argv[1] if len(sys.argv) > 1 else 'unnamed'
# Do some ground work to set up the web installer directory, starting with the installer image assets...
assets_target_dir = os.path.join(Dirs.webinstaller, Dirs.assets)
@@ -205,6 +207,9 @@ class Manifest:
with open(os.path.join(Dirs.config, index_template_file), "r", encoding='utf-8') as f:
index_template = f.read()
+# ...then inject release name...
+index_template = index_template.replace('$$RELEASE_NAME$$', release_name)
+
# ...and write it with the feature legend injected
with open(os.path.join(Dirs.webinstaller, index_file), 'w', encoding='utf-8') as f:
f.write(index_template.replace('$$FEATURE_LEGEND$$', ', '.join(legend_entries)))
\ No newline at end of file