generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (35 loc) · 1.17 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
name: "Release"
on:
workflow_dispatch:
push:
tags:
- '*'
permissions: {}
jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4"
- name: Gather information
shell: bash
run: |
INTEGRATION_DOMAIN=$(yq -r -oj '.domain' custom_components/*/manifest.json) || exit
echo "INTEGRATION_DOMAIN=$INTEGRATION_DOMAIN" | tee "$GITHUB_ENV"
- name: "Adjust version number"
shell: "bash"
run: |
yq -i -o json '.version="${{ github.ref_name }}"' \
"${{ github.workspace }}/custom_components/$INTEGRATION_DOMAIN/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/$INTEGRATION_DOMAIN"
zip "$INTEGRATION_DOMAIN.zip" -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/action-gh-release@v0.1.15
with:
files: ${{ github.workspace }}/custom_components/${{ env.INTEGRATION_DOMAIN }}/${{ env.INTEGRATION_DOMAIN }}.zip