commit 262f87c68e66975c7bb2f3b0e65776fe566d0777 Author: sirmrak Date: Wed Jul 22 13:40:51 2026 +0300 Add .gitea/workflows/update_version.yml diff --git a/.gitea/workflows/update_version.yml b/.gitea/workflows/update_version.yml new file mode 100644 index 0000000..38a466e --- /dev/null +++ b/.gitea/workflows/update_version.yml @@ -0,0 +1,61 @@ +name: Update Version + +on: + push: + branches: + - main + - master + - dev + +jobs: + update-version: + name: Update Version + runs-on: ubuntu-latest + if: github.actor != 'gitea-actions[bot]' && github.actor != 'Gitea Actions Bot' + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT_TOKEN }} + + - name: Determine integration name + id: integration_name + run: | + INTEGRATION_NAME=$(find custom_components -mindepth 1 -maxdepth 1 -type d -exec test -f {}/manifest.json \; -print -quit | xargs basename) + if [ -z "$INTEGRATION_NAME" ]; then + echo "Error: Integration directory not found in custom_components/" + exit 1 + fi + echo "integration_name=$INTEGRATION_NAME" >> $GITHUB_OUTPUT + echo "Detected integration name: $INTEGRATION_NAME" + + - name: Update pyproject.toml with integration name + run: | + sed -i "s|custom_components/INTEGRATION_NAME/manifest.json|custom_components/${{ steps.integration_name.outputs.integration_name }}/manifest.json|g" pyproject.toml + cat pyproject.toml | grep version_variables + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install dependencies + run: pip install python-semantic-release + + - name: Configure Git + run: | + git config --local user.email "actions@gitea.local" + git config --local user.name "Gitea Actions Bot" + + - name: Run semantic-release + env: + GITEA_TOKEN: ${{ secrets.PAT_TOKEN }} + run: | + unset GITHUB_SERVER_URL + unset GITHUB_API_URL + unset GITHUB_REPOSITORY + semantic-release version \ No newline at end of file