-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (69 loc) · 2.26 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions: read-all
jobs:
build:
name: Build
runs-on: ubuntu-latest
needs:
- semver
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: |
.esphome
key: ${{ runner.os }}-${{ hashFiles('src/*') }}-${{ hashFiles('childrensclock.yaml') }}
- uses: devcontainers/ci@a56d055efecd725e8cfe370543b6071b79989cc8 # v0.3
with:
runCmd: rake test
- uses: devcontainers/ci@a56d055efecd725e8cfe370543b6071b79989cc8 # v0.3
with:
runCmd: rake build
env: |
VERSION=${{ needs.semver.outputs.semantic_version}}
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: firmware-factory.bin
path: .esphome/build/childrensclock/.pioenvs/childrensclock/firmware.factory.bin
semver:
name: Generate a semantic version number
runs-on: ubuntu-latest
outputs:
semantic_version: ${{ steps.semver.outputs.semantic_version }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: "0"
- id: semver
uses: lukaszraczylo/semver-generator@721453e3832cf515f09f1b5283e76c36302166a5 # 1.10.215
with:
config_file: .github/semver.yaml
repository_local: true
release-binaries:
name: Release
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs:
- build
- semver
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: firmware-factory.bin
- uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # tag=v1.2.1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: v${{ needs.semver.outputs.semantic_version}}
prerelease: false
title: v${{ needs.semver.outputs.semantic_version}}
files: "firmware-factory.bin"