Publish a new release #28
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: Publish a new release | |
on: | |
workflow_dispatch: | |
jobs: | |
draft_release: | |
name: Release Drafter | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/[email protected] | |
- name: Get integration name | |
id: information | |
shell: bash | |
run: | | |
name=$(find custom_components/ -type d -maxdepth 1 | tail -n 1 | cut -d "/" -f2) | |
echo "name: $name" | |
echo "::set-output name=name::$name" | |
- name: Get integration version from manifest | |
id: version | |
shell: bash | |
run: | | |
version=$(jq -r '.version' custom_components/${{ steps.information.outputs.name }}/manifest.json) | |
echo "version: $version" | |
echo "::set-output name=version::$version" | |
- name: Get Changelog Entry | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
validation_depth: 10 | |
version: ${{ steps.version.outputs.version }} | |
path: ./CHANGELOG.md | |
- name: Create zip file for the integration | |
run: | | |
cd "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}" | |
zip ${{ steps.information.outputs.name }}.zip -r ./ | |
- name: draft github release | |
id: draft_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ steps.version.outputs.version }} | |
tag_name: ${{ steps.version.outputs.version }} | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
files: "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip" | |
draft: true | |
prerelease: false |