diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..4c7c9d4 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,57 @@ +--- +name-template: "$RESOLVED_VERSION" +tag-template: "$RESOLVED_VERSION" +change-template: "- $TITLE @$AUTHOR (#$NUMBER)" +sort-direction: ascending + +categories: + - title: "Breaking changes" + labels: + - "breaking-change" + - title: "New features" + labels: + - "new-feature" + - title: "Bug fixes" + labels: + - "bugfix" + - title: "Enhancements" + labels: + - "enhancement" + - "refactor" + - "performance" + - title: "Maintenance" + labels: + - "maintenance" + - "ci" + - title: "Documentation" + labels: + - "documentation" + - title: "Dependency updates" + labels: + - "dependencies" + +version-resolver: + major: + labels: + - "major" + - "breaking-change" + minor: + labels: + - "minor" + - "new-feature" + patch: + labels: + - "bugfix" + - "chore" + - "ci" + - "dependencies" + - "documentation" + - "enhancement" + - "performance" + - "refactor" + default: patch + +template: | + ## What’s changed + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..5f46002 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,19 @@ +--- +name: Release Drafter + +# yamllint disable-line rule:truthy +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + update_release_draft: + name: Draft release + runs-on: ubuntu-latest + steps: + - name: Run Release Drafter + uses: release-drafter/release-drafter@v6.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4ae4d75 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +--- +name: Release + +# yamllint disable-line rule:truthy +on: + release: + types: + - published + +env: + DEFAULT_PYTHON: "3.12" + +jobs: + release: + name: Releasing to PyPi + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/pydantic-filters + permissions: + id-token: write + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 + - name: Set up Poetry + run: pipx install poetry + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v5.1.0 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache: "poetry" + - name: Install workflow dependencies + run: | + poetry config virtualenvs.create true + poetry config virtualenvs.in-project true + - name: Install dependencies + run: poetry install --no-interaction + - name: Set package version + run: | + version="${{ github.event.release.tag_name }}" + version="${version,,}" + version="${version#v}" + poetry version --no-interaction "${version}" + - name: Build package + run: poetry build --no-interaction + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@v1.8.14 + with: + verbose: true + print-hash: true diff --git a/README.md b/README.md index a01aa38..137633c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ **Source Code:** https://github.com/so-saf/pydantic-filters +[![Testing](https://github.com/so-saf/pydantic-filters/actions/workflows/test.yaml/badge.svg)](https://github.com/so-saf/pydantic-filters/actions/workflows/test.yaml) +[![license](https://img.shields.io/github/license/so-saf/pydantic-filters.svg)](https://github.com/so-saf/pydantic-filters/blob/main/LICENSE) +[![Linting](https://github.com/so-saf/pydantic-filters/actions/workflows/linting.yaml/badge.svg)](https://github.com/so-saf/pydantic-filters/actions/workflows/linting.yaml) + --- Describe the filters, not implement them!