forked from esphome/esphome-webserver
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (94 loc) · 3.07 KB
/
release.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
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
name: Release
on:
push:
branches:
- main
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Captive Portal
directory: captive-portal
- name: Webserver v2
directory: v2
- name: Webserver v3
directory: v3
steps:
- name: Clone the repo
uses: actions/[email protected]
- name: Set up Node.JS
uses: actions/[email protected]
- name: Install dependencies
run: npm install
- name: Build ${{ matrix.name }}
run: npm run build
working-directory: packages/${{ matrix.directory }}
- uses: actions/[email protected]
with:
name: ${{ matrix.name }}
path: _static/**/*.h
release:
name: Tag and Release
runs-on: ubuntu-latest
needs: build
outputs:
tag: ${{ steps.create_tag.outputs.tag }}
steps:
# Checkout repo, create new git tag, and git release with artifacts
- name: Checkout the repo
uses: actions/[email protected]
- name: Create a new tag
id: create_tag
run: echo tag=$(date +'%Y%m%d-%H%M%S') >> $GITHUB_OUTPUT
- name: Download Artifacts
uses: actions/[email protected]
with:
path: headers
merge-multiple: true
- name: List files
run: ls -R headers
- name: Create a release
id: create_release
uses: softprops/[email protected]
with:
tag_name: ${{ steps.create_tag.outputs.tag }}
name: Release ${{ steps.create_tag.outputs.tag }}
files: headers/**/*.h
generate_release_notes: true
esphome-pr:
name: Make PR into ESPHome repo
runs-on: ubuntu-latest
environment: esphome
needs:
- release
steps:
- name: Checkout esphome repo
uses: actions/[email protected]
with:
repository: esphome/esphome
ref: dev
- name: Download Artifacts
uses: actions/[email protected]
with:
path: /tmp/headers
merge-multiple: true
- name: Move headers into palce
run: |-
mv /tmp/headers/captive_portal/captive_index.h esphome/components/captive_portal/captive_index.h
mv /tmp/headers/v2/server_index_v2.h esphome/components/web_server/server_index_v2.h
mv /tmp/headers/v3/server_index_v3.h esphome/components/web_server/server_index_v3.h
- name: PR Changes
uses: peter-evans/[email protected]
with:
commit-message: "Update webserver local assets to ${{ needs.release.outputs.tag }}"
committer: esphomebot <[email protected]>
author: esphomebot <[email protected]>
branch: sync/webserver-assets
delete-branch: true
title: "Update webserver local assets to ${{ needs.release.outputs.tag }}"
body-path: .github/PULL_REQUEST_TEMPLATE.md
token: ${{ secrets.ESPHOME_WEBSERVER_SYNC_TOKEN }}
assignees: "@esphome/core"