Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneNulschDE committed Jan 15, 2024
1 parent 01f1877 commit 478779f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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@v1
with:
files: ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip
tag_name: ${{ github.event.release.tag_name }}

0 comments on commit 478779f

Please sign in to comment.