From ded1535a23fdad8520f0ed74c717d7ef594005af Mon Sep 17 00:00:00 2001 From: Tim Adler Date: Mon, 23 Sep 2024 22:26:11 +0200 Subject: [PATCH] feat (github): Action to automatically version package (#10) --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ pyproject.toml | 10 ++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..efe906e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release a new version + +on: + push: + branches: + - main + +jobs: + release: + name: Release + runs-on: ubuntu-latest + concurrency: release + permissions: + id-token: write + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Python semantic release + uses: python-semantic-release/python-semantic-release@v9.8.8 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 1f9a329..d7d8efe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,3 +51,13 @@ Documentation = "https://Emrys-Merlin.github.io/web_watchr/" Repository = "https://github.com/Emrys-Merlin/web_watchr.git" "Bug Tracker" = "https://github.com/Emrys-Merlin/web_watchr/issues" # Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md" + +[tool.semantic_release] +version_variable = [ + "src/web_watchr/__init__.py:__version__" +] +major_on_zero = true +branch = "main" +upload_to_PyPI = true +upload_to_release = true +build_command = "make setup && make build"