Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial setup checklist #23

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
#### Modify below here to match your project ####
file:
- project-template-esp32
- project-template-esp32-c3
- project-template-esp32-s3
#### Modify above here to match your project ####

esphome-version:
- stable
- beta
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/publish-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ on:
jobs:
build-firmware:
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@2024.10.0
uses: esphome/workflows/.github/workflows/build.yml@2024.11.1
with:
#### Modify below here to match your project ####
files: |
project-template-esp32.factory.yaml
project-template-esp32-c3.factory.yaml
project-template-esp32-s3.factory.yaml
esphome-version: 2024.10.3
combined-name: firmware
combined-name: project-template
#### Modify above here to match your project ####

release-summary: ${{ github.event.release.body }}
release-url: ${{ github.event.release.html_url }}
release-version: ${{ github.event.release.tag_name }}

upload-to-release:
name: Upload to Release
uses: esphome/workflows/.github/workflows/upload-to-gh-release.yml@main
uses: esphome/workflows/.github/workflows/upload-to-gh-release.yml@2024.11.1
needs:
- build-firmware
with:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/repository-generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Repository Generated

on:
push:
branches:
- main

jobs:
setup:
runs-on: ubuntu-latest
if: ${{ !github.event.repository.is_template }}
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Create issue from setup checklist template
uses: peter-evans/create-issue-from-file@v5
with:
title: Setup Checklist
content-filepath: _template/setup-checklist.md
assignees: ${{ github.repository_owner }}

- name: Delete self
run: rm -rf .github/workflows/repository-generated.yml
- name: Remove template directory
run: rm -rf _template

- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Remove template files"
git push
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,5 @@ easily install your project onto their device.
## Instructions

1. Use this repo template to [generate](https://github.com/esphome/esphome-project-template/generate) your own repository.
- Make sure to check `Include all branches` so that GitHub Pages is automatically enabled.
2. Clone your new repository.
3. Add your project specific YAML configuration(s) along with the contents of the `project-template-....yaml` files, taking note of the comments in this template file and name accordingly.
4.
a. Update [.github/workflows/publish.yml](.github/workflows/publish.yml) to contain your own YAML config filename(s).
b. Update [.github/workflows/ci.yml](.github/workflows/ci.yml) to contain your own YAML config filename(s).
5. Update [static/_config.yml](static/_config.yml) to change the title, description and basic theme of the generated website.
6. Add more content to the [static/index.md](static/index.md) file to explain your project.
Make sure to leave the installation code tags in place so users get the install button.
7. Add permission to github-actions[bot]
a. go to your project Settings, under the Actions collapsible, click on General.
b. scroll down until you find Workflow permissions and mark the option Read and write permissions.
c. Hit the save button
8. Push your changes to the repository and GitHub Actions will automatically build and deploy your project.

3. Follow the checklist created as an issue in your new repository.
25 changes: 25 additions & 0 deletions _template/setup-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Repository Setup

- [ ] Replace the *.yaml files in the root of the repository with your project specific YAML configuration(s).
- [ ] `.github/workflows/publish-firmware.yml`
- [ ] `files` - Update YAML config filename(s).
- [ ] `esphome-version` - Update ESPHome version.
- [ ] `combined-name` - Update the combined name of the firmware.
Remove this line if you only target one microcontroller chip.
- [ ] `.github/workflows/ci.yml`
- [ ] `matrix` -> `file` - Update YAML config filename(s).
- [ ] `static/_config.yml`
- [ ] Set the title.
- [ ] Set the description.
- [ ] Optionally change the basic theme.
- [ ] `static/index.md`
- [ ] Update the manifest path. This will be `<combined-name>.manifest.json` if you use the `combined-name` in the publish-firmware.yml, otherwise it will be `<name>.manifest.json` where `<name>` is the value from `esphome` -> `name` in your YAML configuration.
- [ ] Add some more content to the page.
- [ ] Set up GitHub Pages
1. Go to **Repository Settings** -> **Pages** ([click here](../settings/pages)).
2. Change the **Build and Deployment** -> **Source** to `GitHub Actions`.
- [ ] Add write permission to for GitHub Actions
1. Go to **Repository Settings** -> **Actions** ([click here](../settings/actions)).
2. Change **Workflow permissions** to be `Read and write permissions`.
3. Hit the save button.
- [ ] Make a [release](../releases/new) to trigger the first build and deploy the website.
2 changes: 1 addition & 1 deletion static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Add some information about your project here.

You can use the button below to install the pre-built firmware directly to your device via USB from the browser.

<esp-web-install-button manifest="firmware/firmware.manifest.json"></esp-web-install-button>
<esp-web-install-button manifest="firmware/project-template.manifest.json"></esp-web-install-button>

<script type="module" src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"></script>