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
5 changes: 3 additions & 2 deletions .github/publish-git-tag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env bash

git tag `python setup.py --version`
git push --tags || true # update the repository version
VERSION=$(python -c "import re; print(re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1))")
git tag "$VERSION"
git push --tags || true
22 changes: 13 additions & 9 deletions .github/workflows/versioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,33 @@ on:
- main

paths:
- changelog_entry.yaml
- .github/**
- changelog.d/**
- pyproject.toml
workflow_dispatch:

jobs:
Versioning:
if: (github.event.head_commit.message != 'Update package version')
runs-on: ubuntu-latest
if: |
(!(github.event.head_commit.message == 'Update package version'))
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.POLICYENGINE_GITHUB }}
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Build changelog
run: pip install yaml-changelog && make changelog
- name: Preview changelog update
run: ".github/get-changelog-diff.sh"
- name: Install towncrier
run: uv pip install towncrier --system
- name: Bump version and build changelog
run: |
python .github/bump_version.py
towncrier build --yes --version $(python -c "import re; print(re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1))")
- name: Update changelog
uses: EndBug/add-and-commit@v9
with:
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ dev = [
"sphinx-argparse>=0.3.2,<1",
"sphinx-math-dollar>=1.2.1,<2",
"wheel",
"yaml-changelog>=0.1.7",
"towncrier>=24.8.0",
"snowballstemmer>=2,<3",
"jupyter-book>=2.0.0a0",
"rich",
"towncrier>=24.8.0",
]

[tool.pytest.ini_options]
Expand Down