Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,36 +93,54 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

release:
runs-on: ubuntu-latest
environment: release
if: github.ref == 'refs/heads/master'
needs:
- test
- lint
- commitlint

runs-on: ubuntu-latest
environment: release
concurrency: release
permissions:
id-token: write
contents: write
outputs:
released: ${{ steps.release.outputs.released }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref_name }}

# Run semantic release:
# - Update CHANGELOG.md
# - Update version in code
# - Create git tag
# - Create GitHub release
# - Publish to PyPI
- name: Python Semantic Release
uses: relekang/python-semantic-release@v7.34.6
# env:
# REPOSITORY_URL: https://test.pypi.org/legacy/
# TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
# Do a dry run of PSR
- name: Test release
uses: python-semantic-release/python-semantic-release@v9.12.0
if: github.ref_name != 'master'
with:
root_options: --noop

# On main branch: actual PSR + upload to PyPI & GitHub
- name: Release
uses: python-semantic-release/python-semantic-release@v9.12.0
id: release
if: github.ref_name == 'master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}

build_wheels:
needs: [release]
if: needs.release.outputs.released == 'true'

name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -139,6 +157,8 @@ jobs:
# Used to host cibuildwheel
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install python-semantic-release
run: pipx install python-semantic-release==7.34.6
Expand All @@ -161,7 +181,7 @@ jobs:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
uses: pypa/cibuildwheel@v2.21.3
# to supply options, put them in 'env', like:
env:
CIBW_SKIP: cp36-* cp37-* pp36-* pp37-* *p38-*_aarch64 cp38-*_arm64 *p39-*_aarch64 *p310-*_aarch64 pp*_aarch64 *musllinux*_aarch64
Expand Down
22 changes: 20 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,29 @@ script = "build_ext.py"

[tool.semantic_release]
branch = "master"
version_toml = "pyproject.toml:tool.poetry.version"
version_variable = "src/zeroconf/__init__.py:__version__"
version_toml = ["pyproject.toml:tool.poetry.version"]
version_variables = [
"src/zeroconf/__init__.py:__version__"
]
build_command = "pip install poetry && poetry build"
tag_format = "{version}"

[tool.semantic_release.changelog]
exclude_commit_patterns = [
"chore*",
"ci*",
]

[tool.semantic_release.changelog.environment]
keep_trailing_newline = true

[tool.semantic_release.branches.master]
match = "master"

[tool.semantic_release.branches.noop]
match = "(?!master$)"
prerelease = true

[tool.poetry.dependencies]
python = "^3.8"
async-timeout = {version = ">=3.0.0", python = "<3.11"}
Expand Down