-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathaction.yml
More file actions
88 lines (83 loc) · 2.65 KB
/
action.yml
File metadata and controls
88 lines (83 loc) · 2.65 KB
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
name: ESPHome Builder
description: Builds ESPHome binaries
inputs:
yaml-file:
description: YAML file to use
required: true
version:
description: Version of ESPHome to build
required: false
default: latest
platform:
description: Platform (OS/Arch) to use
required: false
default: linux/amd64
deprecationMessage: |
The platform input is no longer used. ESPHome and this action supports
amd64 and arm64, both are supported by GitHub as the job runner architecture
by altering `runs-on` in the workflow.
release-summary:
description: Release summary
required: false
default: ""
release-url:
description: Release URL
required: false
default: ""
complete-manifest:
description: Output complete esp-web-tools manifest.json
required: false
default: false
outputs:
name:
description: Name of device extracted from configuration with the platform appended
value: ${{ steps.build-step.outputs.name }}
version:
description: ESPHome version
value: ${{ steps.build-step.outputs.esphome-version }}
original-name:
description: Original name of device extracted from configuration
value: ${{ steps.build-step.outputs.original-name }}
project-name:
description: Project name extracted from configuration
value: ${{ steps.build-step.outputs.project-name }}
project-version:
description: Project version extracted from configuration
value: ${{ steps.build-step.outputs.project-version }}
runs:
using: composite
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Build ESPHome image
uses: docker/build-push-action@v6.18.0
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: ${{ github.action_path }}
load: true
tags: esphome:${{ inputs.version }}
build-args: VERSION=${{ inputs.version }}
- name: Run container
shell: bash
id: build-step
run: |-
summary=$(cat <<'ENDOFSUMMARY'
${{ inputs.release-summary }}
ENDOFSUMMARY
)
docker run --rm \
--workdir /github/workspace \
-v "$(pwd)":"/github/workspace" -v "$HOME:$HOME" \
--user $(id -u):$(id -g) \
-e HOME \
esphome:${{ inputs.version }} \
${{ inputs.yaml-file }} \
--release-summary "$summary" \
--release-url "${{ inputs.release-url }}" \
--outputs-file "$GITHUB_OUTPUT" \
${{ inputs.complete-manifest == 'true' && '--complete-manifest' || '--partial-manifest' }}
branding:
icon: "archive"
color: "white"