-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 2.07 KB
/
Copy pathpublisher.yaml
File metadata and controls
62 lines (54 loc) · 2.07 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
name: Publisher
on:
push:
branches:
- '**'
tags:
- '*'
jobs:
tests:
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out the repository
uses: actions/checkout@v6.0.2
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry install --with dev --no-interaction --no-ansi
- name: Run tests
run: python -m poetry run pytest
publish:
runs-on: ubuntu-latest
name: Publish
needs: tests
if: ${{ (github.ref_type == 'branch' && github.ref_name == 'dev') || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) }}
steps:
- name: Check out the repository
uses: actions/checkout@v6.0.2
- name: Prepare build data
id: build_data
run: |
if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "dev" ]]; then
echo "app=evohome_helper_edge" >> $GITHUB_OUTPUT
echo "version=dev-$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref_type }}" == "tag" && "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "app=evohome_helper" >> $GITHUB_OUTPUT
echo "version=$(echo "${{ github.ref_name }}" | sed 's/^v//')" >> $GITHUB_OUTPUT
else
exit 1
fi
echo "artifact_url=${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.tar.gz" >> $GITHUB_OUTPUT
- name: Trigger app build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: builder.yaml
repo: ${{ github.repository_owner }}/ha-apps
ref: master
inputs: '{ "app": "${{ steps.build_data.outputs.app }}", "version": "${{ steps.build_data.outputs.version }}", "artifact_url": "${{ steps.build_data.outputs.artifact_url }}" }'
token: '${{ secrets.HA_APPS_PAT }}'