-
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.21 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
name: Release Workflow
on:
release:
types:
- published
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Get integration information
id: information
run: |
name=$(find custom_components/ -type d -maxdepth 1 | tail -n 1 | cut -d "/" -f2)
echo "name=$name" >> $GITHUB_OUTPUT
- name: Adjust version number
shell: bash
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json"
- name: Create zip file for the integration
shell: bash
run: |
cd "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}"
zip ${{ steps.information.outputs.name }}.zip -r ./
- name: Upload the zipfile as a release asset
uses: softprops/action-gh-release@v2
with:
files: ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip
tag_name: ${{ github.event.release.tag_name }}