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
47 changes: 47 additions & 0 deletions .github/workflows/bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Bump version

on:
workflow_dispatch:
inputs:
bump:
description: "Version component to bump"
type: choice
options: [major, minor, patch, stable, alpha, beta, rc, post, dev]
default: patch

permissions:
contents: write
pull-requests: write

jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2

- name: Bump version
run: |
uv version --bump ${{ inputs.bump }}
echo "VERSION=$(uv version --short)" >> "$GITHUB_ENV"

- name: Open release PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

BRANCH="release/v${VERSION}"
git switch -c "$BRANCH"
git commit -am "Release v${VERSION}"
git push --force-with-lease origin "$BRANCH"

gh pr create \
--base main \
--head "$BRANCH" \
--title "Release v${VERSION}" \
--body "Automated version bump to \`v${VERSION}\`."
7 changes: 6 additions & 1 deletion src/dstrack/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from importlib.metadata import PackageNotFoundError, version

from . import _logging as _logging

__version__ = "0.1.0"
try:
__version__ = version("dstrack")
except PackageNotFoundError:
__version__ = "unknown"