diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf56e62..006aa91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,42 @@ jobs: with: files: ${{ env.basedir }}/${{ env.package }}.zip + release-notes: + name: "Compose release notes" + needs: release + runs-on: ubuntu-latest + steps: + - name: "Check out repository" + uses: actions/checkout@v3 + + - working-directory: ./custom_components + run: | + echo "release_version=$(git describe --tags | sed s/v//)" >> $GITHUB_ENV + + - name: "Set up Python" + if: env.release_version != '' && success() + uses: actions/setup-python@v3 + with: + python-version: 3.9 + + - name: "Cache pip" + if: env.release_version != '' && success() + uses: actions/cache@v3 + with: + # This path is specific to Ubuntu + path: ~/.cache/pip + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: "Install requirements" + if: env.release_version != '' && success() + run: | + python3 -m pip install setuptools wheel + python3 -m pip install -r ./requirements-dev.txt + - name: "Update release notes" if: env.release_version != '' && success() run: python3 ./bin/gen_releasenotes --token ${{ secrets.GITHUB_TOKEN }} --repo ${{ github.repository }} --release ${{ env.release_version }}