diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..d5e46b7 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,15 @@ +# These are supported funding model platforms + +github: Jezza34000 +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +polar: # Replace with a single Polar username +buy_me_a_coffee: jezza +thanks_dev: # Replace with a single thanks.dev username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57b4820..f0f75a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,36 @@ on: permissions: {} jobs: + + python-semantic-release: + runs-on: ubuntu-latest + concurrency: python-semantic-release + steps: + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.VERSION_MANAGER_APP_ID }} + private-key: ${{ secrets.VERSION_MANAGER_APP_PRIVATE_KEY }} + + - name: Setup | Checkout Repository at workflow sha + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.sha }} + token: ${{ steps.app-token.outputs.token }} + + - name: Setup | Force correct release branch on workflow sha + run: | + git checkout -B ${{ github.ref_name }} ${{ github.sha }} + + - name: Action | Semantic Version Release + id: release + uses: python-semantic-release/python-semantic-release@v9 + with: + github_token: ${{ steps.app-token.outputs.token }} + git_committer_name: "github-actions" + git_committer_email: "actions@users.noreply.github.com" + release: name: "Release" runs-on: "ubuntu-latest" diff --git a/pyproject.toml b/pyproject.toml index 7928775..891e940 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -266,10 +266,6 @@ push = true "{version}", "{pep440_version}", ] -"README.md" = [ - "{version}", - "{pep440_version}", -] [tool.tox] envlist = ["pre-commit"] @@ -277,3 +273,47 @@ envlist = ["pre-commit"] [testenv.pre-commit] deps = ["pre-commit"] commands = ["pre-commit run --all-files"] + +# Python Semantic Release Configuration +[tool.semantic_release] +commit_parser = "emoji" +commit_message = "{version}\n\nAutomatically generated by python-semantic-release\n" +version_variables = ["custom_components/petkit/manifest.json:version"] + +[tool.semantic_release.changelog] +mode = "update" + +[tool.semantic_release.branches.main] +match = "(master)" + +[tool.semantic_release.commit_parser_options] +default_bump_level = 2 # 1: pre-release / 2: patch / 3: minor / 4: major +major_tags = ["๐Ÿ’ฅ", ":boom:", "BREAKING CHANGE"] +minor_tags = [ + "โœจ", ":sparkles:", "๐Ÿšธ", ":children_crossing:","๐Ÿ’„", ":lipstick:", + "๐Ÿ“ฑ", ":iphone:", "๐Ÿฅš", ":egg:", "๐Ÿ“ˆ", ":chart_with_upwards_trend:", + "feat" +] +patch_tags = [ + "๐ŸŽจ", ":art:", "โšก๏ธ", ":zap:", "๐Ÿ”ฅ", ":fire:", "๐Ÿ›", ":bug:", "๐Ÿš‘๏ธ", ":ambulance:", + "๐Ÿ“", ":memo:", "๐Ÿš€", ":rocket:", "๐ŸŽ‰", ":tada:", "โœ…", ":white_check_mark:", + "๐Ÿ”’๏ธ", ":lock:", "๐Ÿ”", ":closed_lock_with_key:", "๐Ÿ”–", ":bookmark:", + "๐Ÿšจ", ":rotating_light:", "๐Ÿšง", ":construction:", "๐Ÿ’š", ":green_heart:", + "โฌ‡๏ธ", ":arrow_down:", "โฌ†๏ธ", ":arrow_up:", "๐Ÿ“Œ", ":pushpin:", + "๐Ÿ‘ท", ":construction_worker:", "โ™ป๏ธ", ":recycle:", "โž•", ":heavy_plus_sign:", + "โž–", ":heavy_minus_sign:", "๐Ÿ”ง", ":wrench:", "๐Ÿ”จ", ":hammer:", + "๐ŸŒ", ":globe_with_meridians:", "โœ๏ธ", ":pencil2:", "๐Ÿ’ฉ", ":poop:", "โช๏ธ", ":rewind:", + "๐Ÿ”€", ":twisted_rightwards_arrows:", "๐Ÿ“ฆ๏ธ", ":package:", "๐Ÿ‘ฝ๏ธ", ":alien:", + "๐Ÿšš", ":truck:", "๐Ÿ“„", ":page_facing_up:", "๐Ÿ’ฅ", ":boom:", "๐Ÿฑ", ":bento:", + "โ™ฟ๏ธ", ":wheelchair:", "๐Ÿ’ก", ":bulb:", "๐Ÿป", ":beers:", "๐Ÿ’ฌ", ":speech_balloon:", + "๐Ÿ—ƒ๏ธ", ":card_file_box:", "๐Ÿ”Š", ":loud_sound:", "๐Ÿ”‡", ":mute:", + "๐Ÿ‘ฅ", ":busts_in_silhouette:", "๐Ÿ—๏ธ", ":building_construction:", "๐Ÿ“ฑ", ":iphone:", + "๐Ÿคก", ":clown_face:", "๐Ÿ™ˆ", ":see_no_evil:", "๐Ÿ“ธ", ":camera_flash:", + "โš—๏ธ", ":alembic:", "๐Ÿ”๏ธ", ":mag:", "๐Ÿท๏ธ", ":label:", "๐ŸŒฑ", ":seedling:", + "๐Ÿšฉ", ":triangular_flag_on_post:", "๐Ÿฅ…", ":goal_net:", "๐Ÿ’ซ", ":dizzy:", + "๐Ÿ—‘๏ธ", ":wastebasket:", "๐Ÿ›‚", ":passport_control:", "๐Ÿฉน", ":adhesive_bandage:", + "๐Ÿง", ":monocle_face:", "โšฐ๏ธ", ":coffin:", "๐Ÿงช", ":test_tube:", "๐Ÿ‘”", ":necktie:", + "๐Ÿฉบ", ":stethoscope:", "๐Ÿงฑ", ":bricks:", "โ€๐Ÿ’ป", ":technologist:", + "๐Ÿ’ธ", ":money_with_wings:", "๐Ÿงต", ":thread:", "๐Ÿฆบ", ":safety_vest:", + "build", "chore", "ci", "docs", "fix", "perf", "style", "refactor", "test" +] diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..01545ab --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,10 @@ +sonar.projectKey=jezza34000_homeassistant_petkit +sonar.organization=Jezza34000 + +sonar.tests=tests +sonar.sources=custom_components/petkit +sonar.exclusions=**/tests/** + +sonar.language=py +sonar.python.version=3.11, 3.12, 3.13 +sonar.python.coverage.reportPaths=coverage.xml