v1.0 #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v0.1.15 | |
with: | |
files: ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip |