Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Validate found release version (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus authored Sep 25, 2023
1 parent 903a028 commit 7559efe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,27 @@ jobs:
echo "::set-output name=name::$name"
min_ha_version=$(jq -r '.homeassistant' ${{ github.workspace }}/hacs.json)
echo "::set-output name=min_ha_version::$min_ha_version"
- name: 🖊️ Set version number
run: |
sed -i '/INTEGRATION_VERSION = /c\INTEGRATION_VERSION = "${{ steps.version.outputs.version }}"' \
"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py"
jq '.version = "${{ steps.version.outputs.version }}"' \
"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json" > tmp \
&& mv -f tmp "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json"
- name: 🖊️ Set min required HA version
run: |
sed -i '/MIN_REQUIRED_HA_VERSION = /c\MIN_REQUIRED_HA_VERSION = "${{ steps.information.outputs.min_ha_version }}"' \
"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py"
- name: 👀 Validate data
run: |
echo "Version found :${{ steps.version.outputs.version }}";
if [[ '${{ steps.version.outputs.version }}' == '""' ]]; then
echo "Did not correctly identify version"
exit 1
fi
if ! grep -q 'INTEGRATION_VERSION = "${{ steps.version.outputs.version }}"' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py; then
echo "The version in custom_components/${{ steps.information.outputs.name }}/const.py was not correct"
cat ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py | grep INTEGRATION_VERSION
Expand All @@ -60,10 +68,12 @@ jobs:
cat ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py | grep MIN_REQUIRED_HA_VERSION
exit 1
fi
- 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: 📤 Upload the zip file as a release asset
uses: actions/upload-release-asset@v1
env:
Expand Down

0 comments on commit 7559efe

Please sign in to comment.