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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
run: uv sync --dev

- name: Run Tests
run: uv run ./scripts/run-tests.sh
run: uv run ./run-tests.sh
61 changes: 0 additions & 61 deletions .github/workflows/pre-release.yaml

This file was deleted.

73 changes: 25 additions & 48 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: Tag & Release

on:
pull_request:
types:
- "closed"
push:
branches:
- "main"
- 'main'

jobs:
build_and_release:
if: github.event.pull_request.merged == true && !startsWith(github.head_ref, 'release')
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v2
with:
enable-cache: true

Expand All @@ -24,58 +21,38 @@ jobs:
with:
python-version-file: ".python-version"

- name: Bump version
run: |
git config user.name "Release Bot"
git config user.email "dev@beauhurst.com"
./scripts/bump-version.sh

- name: Get new version
id: version
run: echo "VERSION=$(uvx --from toml-cli toml get --toml-path pyproject.toml project.version)" >>$GITHUB_OUTPUT
- name: Install dev dependencies
run: uv sync --dev

- name: Build binary wheel and a source tarball
run: |
uv build \
--package pyap_beauhurst \
--out-dir dist

- name: Create release branch, push branch, tag and create PR
env:
TAG_NAME: "v${{ steps.version.outputs.VERSION }}"
BRANCH_NAME: "release-v${{ steps.version.outputs.VERSION }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |

git checkout -b "$BRANCH_NAME"
git push origin "$BRANCH_NAME"
git push origin tag "$TAG_NAME"

# create release PR
gh pr create \
--title "Release $TAG_NAME" \
--head "$(git branch --show-current)" \
--fill \
--base main
- name: Get version
run: echo "VERSION=$(uv version --short)" >>$GITHUB_OUTPUT
id: version

- name: Merge it
env:
TAG_NAME: "v${{ steps.version.outputs.VERSION }}"
GH_TOKEN: ${{ secrets.GA_PAT }}
run: |
# Merge PR
gh pr merge --admin --squash
- name: Tag with updated version
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.version.outputs.VERSION }}

- name: Create a GitHub Release
uses: softprops/action-gh-release@v2
- name: Create a GitHub release and upload artifact
uses: ncipollo/release-action@v1
with:
prerelease: false
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
generateReleaseNotes: true
artifacts: './dist/pyap_beauhurst-${{ steps.tag_version.outputs.new_version }}.tar.gz,./dist/pyap_beauhurst-${{ steps.tag_version.outputs.new_version }}-py3-none-any.whl'
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
files: "./dist/pyap_beauhurst-*"
make_latest: true
tag_name: ${{ steps.version.outputs.VERSION }}

- name: Latest tag
uses: EndBug/latest-tag@v1

- name: Publish to pypi
run: |
uv publish --token ${{ secrets.PYPI_TOKEN }}
uv publish --token ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.11.12
37 changes: 1 addition & 36 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyap-beauhurst"
version = "1999.1.1"
version = "0.5.0"
description = "Pyap is an MIT Licensed text processing library, written in Python, for detecting and parsing addresses. Currently it supports USA, Canadian and British addresses. This is a fork maintained by Beauhurst."
repository = "https://github.com/Beauhurst/pyap"
requires-python = ">=3.11,<3.14"
Expand Down Expand Up @@ -112,38 +112,3 @@ omit = ["tests/*"]

[tool.coverage.report]
show_missing = true

[tool.bumpversion]
current_version = "1999.1.1"
parse = """(?x) # Verbose mode
(?P<release> # The release part
(?:[1-9][0-9]{3})\\. # YYYY.
(?:1[0-2]|[1-9]) # MM.
)
\\.(?P<num>0|[1-9]\\d*) # num version number
(?:
-(?P<pre_label>dev|stable) # pre_release label
(?P<pre_release>0|[1-9]\\d*) # pre_release version number
)?
"""
serialize = ["{release}.{num}-{pre_label}{pre_release}", "{release}.{num}"]
search = "{current_version}"
replace = "{new_version}"
tag = true
tag_name = "v{new_version}"
tag_message = "v{new_version}"
commit = true
message = "v{new_version}"

[tool.bumpversion.parts.release]
calver_format = "{YYYY}.{MM}"

[tool.bumpversion.parts.num]
independent = false

[tool.bumpversion.parts.pre_label]
optional_value = "stable"
values = ["dev", "stable"]

[[tool.bumpversion.files]]
filename = "pyproject.toml"
File renamed without changes.
43 changes: 0 additions & 43 deletions scripts/bump-version.sh

This file was deleted.