Skip to content

Commit

Permalink
Provided updated publish workflow (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Aug 19, 2024
1 parent e7f479d commit 9512bbb
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 204 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,36 @@ name: CI
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
ci:
name: Building ${{ matrix.file }}
name: Building ${{ matrix.file }} / ${{ matrix.esphome-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
file:
- project-template-esp32-release.yaml
- project-template-esp32-c3-release.yaml
- project-template-esp32-s3-release.yaml
- project-template-esp32
- project-template-esp32-c3
- project-template-esp32-s3
esphome-version:
- stable
- beta
- dev
steps:
- name: Checkout source code
uses: actions/[email protected]
- name: Build ESPHome firmware to verify configuration
uses: esphome/[email protected]
- name: ESPHome ${{ matrix.esphome-version }}
uses: esphome/[email protected]
with:
yaml-file: ${{ matrix.file }}.yaml
version: ${{ matrix.esphome-version }}
- name: ESPHome ${{ matrix.esphome-version }} Factory
uses: esphome/[email protected]
with:
yaml_file: ${{ matrix.file }}
yaml-file: ${{ matrix.file }}.factory.yaml
version: ${{ matrix.esphome-version }}
60 changes: 54 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,63 @@
name: Build and Publish ESPHome firmware and website
name: Publish

on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
description: 'The version of the firmware to build'
required: true
release:
types: [published]

jobs:
build:
uses: esphome/workflows/.github/workflows/publish.yml@main
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@main
with:
# CHANGEME: Set the filenames of your config files here:
files: project-template-esp32-release.yaml,project-template-esp32-c3-release.yaml,project-template-esp32-s3-release.yaml
# CHANGEME: Set the name of your project here:
name: Template Project
files: |
esp32-s3-box/esp32-s3-box.factory.yaml
esp32-s3-box-lite/esp32-s3-box-lite.factory.yaml
esp32-s3-box-3/esp32-s3-box-3.factory.yaml
m5stack-atom-echo/m5stack-atom-echo.factory.yaml
esphome-version: 2024.7.3
combined-name: project-template
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
release-version: ${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}

publish:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
needs: [build]
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: output

- name: Build
uses: actions/[email protected]
with:
source: ./static
destination: ./output

- uses: actions/[email protected]
with:
path: output
retention-days: 1

- name: Setup Pages
uses: actions/[email protected]

- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
55 changes: 0 additions & 55 deletions project-template-esp32-c3-release.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions project-template-esp32-c3.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
packages:
# Include all of the core configuration
core: !include project-template-esp32-c3.yaml

esphome:
# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: dev # This will be replaced by the github workflows with the `release` version

# This should point to the public location of the yaml file that will be adopted.
# In this case it is the core yaml file that does not contain the extra things
# that are provided by this factory yaml file as the user does not need these once adopted.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-c3.yaml@main

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
improv_serial:
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ esphome:
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32-c3-devkitm-1
framework:
Expand Down
55 changes: 0 additions & 55 deletions project-template-esp32-release.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions project-template-esp32-s3-release.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions project-template-esp32-s3.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
packages:
# Include all of the core configuration
core: !include project-template-esp32-s3.yaml

esphome:
# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: dev # This will be replaced by the github workflows with the `release` version

# This should point to the public location of the yaml file that will be adopted.
# In this case it is the core yaml file that does not contain the extra things
# that are provided by this factory yaml file as the user does not need these once adopted.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-s3.yaml@main

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
improv_serial:
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ esphome:
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf

Expand Down
25 changes: 25 additions & 0 deletions project-template-esp32.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
packages:
# Include all of the core configuration
core: !include project-template-esp32.yaml

esphome:
# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: dev # This will be replaced by the github workflows with the `release` version

# This should point to the public location of the yaml file that will be adopted.
# In this case it is the core yaml file that does not contain the extra things
# that are provided by this factory yaml file as the user does not need these once adopted.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-adopt.yaml@main

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
improv_serial:
Loading

0 comments on commit 9512bbb

Please sign in to comment.