diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eaffe0..6d5cb60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Semantic Release +name: Release on: push: @@ -7,22 +7,22 @@ on: jobs: release: + runs-on: ubuntu-latest permissions: contents: write - - runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 + with: + fetch-depth: 0 # Fetch all history for semantic-release - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: | - uv sync + run: uv sync - - name: Run semantic-release + - name: Release env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: uv run semantic-release version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b43e12b..36ac4e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,8 +4,6 @@ on: pull_request: branches: ["main"] types: [opened, synchronize, reopened, ready_for_review] - push: - branches: ["main"] jobs: test: @@ -13,20 +11,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.13"] # Only test min and max supported versions + python-version: ["3.9", "3.13"] # Min and max supported versions steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | - make install-dev + run: make install - - name: Run tests - run: | - make test + - name: Test + run: make test diff --git a/Makefile b/Makefile index f438f95..b36c26c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ -install-dev: - @echo "Installing local package..." +install: uv sync +install-dev: + @$(MAKE) install uv run pre-commit install + test: @echo "Running tests..." uv run pre-commit run --all-files diff --git a/pyproject.toml b/pyproject.toml index 5f05c75..8864dff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,7 @@ patch_tags = ["fix", "perf"] [tool.semantic_release] commit_message = "{version}\n\nAutomatically generated by python-semantic-release" commit_parser = "conventional" +allow_zero_version = true major_on_zero = false build_command = """ uv lock --upgrade-package "$PACKAGE_NAME"