fix settings not being reflected, fix protobuf library issue, add ded… #387
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Trigger on version tags | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write # Required for creating releases | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Check versions match tag | |
| run: | | |
| # Extract version from pyproject.toml | |
| PACKAGE_VERSION=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') | |
| # Extract version from manifest.json | |
| MANIFEST_VERSION=$(jq -r .version custom_components/mammotion/manifest.json) | |
| # Get version from tag | |
| TAG_VERSION=${{ steps.get_version.outputs.version }} | |
| if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Package version ($PACKAGE_VERSION) in pyproject.toml does not match tag version ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| if [ "$MANIFEST_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Manifest version ($MANIFEST_VERSION) in manifest.json does not match tag version ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Get previous version | |
| id: get_previous_version | |
| run: | | |
| # Get the previous tag, or the first commit if no previous tag exists | |
| previous_tag=$(git tag --sort=-v:refname | sed -n 2p) | |
| if [ -z "$previous_tag" ]; then | |
| previous_tag=$(git rev-list --max-parents=0 HEAD) | |
| fi | |
| echo "previous_version=${previous_tag}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| { | |
| echo 'changelog<<EOF' | |
| echo $(git log --pretty=format:"- %h - %an: %s" ${{ steps.get_previous_version.outputs.previous_version }}..${{ github.ref_name }} | sed 's|%0A|\n|g' | sed 's|%0D|\r|g') | |
| echo EOF | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Create Release | |
| id: create_release | |
| uses: comnoco/create-release-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| body: | | |
| # Mammotion - Home Assistant Integration ${{ github.ref_name }} 🚀 | |
| [](https://discord.gg/vpZdWhJX8x) | |
| This release brings new features and improvements to the Mammotion integration for Home Assistant. 🌿🤖 | |
| ## What's New 🎉 | |
| ${{ steps.changelog.outputs.changelog }} | |
| ## Installation 🛠️ | |
| 1. Use HACS to install this custom repository. | |
| 2. Restart Home Assistant. | |
| 3. Add the Mammotion integration via the UI. | |
| For detailed instructions, please refer to the [README](https://github.com/${{ github.repository }}/blob/main/README.md). | |
| ## Feedback and Support 💬 | |
| If you encounter any issues or have suggestions, please: | |
| - [Open an issue](https://github.com/${{ github.repository }}/issues) on GitHub | |
| - [Join our Discord](https://discord.gg/vpZdWhJX8x) for community support | |
| ## Thank You 🙏 | |
| A big thank you to all contributors and users of this integration. Your feedback and support help make this project better! | |
| **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.get_previous_version.outputs.previous_version }}...${{ github.ref_name }} | |
| draft: false | |
| prerelease: false |