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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-python@v5
- uses: actions/setup-python@v7
with:
python-version: "3.12"

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR title

on:
pull_request:
types: [opened, edited, synchronize, reopened]

permissions:
pull-requests: read

jobs:
conventional:
runs-on: ubuntu-latest
steps:
- name: Check PR title follows Conventional Commits
uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-python@v5
- uses: actions/setup-python@v7
with:
python-version: "3.12"

Expand All @@ -24,3 +24,8 @@ jobs:

- name: Pytest
run: pytest

- name: Build
run: |
pip install build
python -m build
71 changes: 71 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: release
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ github.ref_name }}
fetch-depth: 0

- name: Reset to the workflow commit
run: git reset --hard ${{ github.sha }}

- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Install dependencies
run: pip install -e ".[dev]" httpx types-jsonschema

- name: Ruff
run: ruff check .

- name: Mypy
run: mypy .

- name: Generate types
run: python -m decodo.codegen.codegen

- name: Pytest
run: pytest

- name: Release
id: release
uses: python-semantic-release/python-semantic-release@v10.7.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit: "false"
changelog: "false"

- name: Build
if: steps.release.outputs.released == 'true'
run: |
pip install build
python -m build

- name: Publish to PyPI
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
37 changes: 0 additions & 37 deletions .github/workflows/worklfow.yml

This file was deleted.

10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing

## Releases

Releases are automated with python-semantic-release. Merging to `main` publishes a new
PyPI version based on the PR title, which must follow
[Conventional Commits](https://www.conventionalcommits.org) (a CI check enforces it):
`fix:` → patch, `feat:` → minor, `feat!:` or a `BREAKING CHANGE:` footer → major.
`chore:`, `docs:`, `ci:`, `refactor:`, `test:` don't release. Don't edit `version` in
`pyproject.toml`; the release job sets it at publish time.
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "decodo-sdk"
version = "2.4.0"
version = "0.0.0"
description = "Official Python SDK for the Decodo APIs"
readme = "README.md"
license = { file = "LICENSE" }
Expand Down Expand Up @@ -65,3 +65,9 @@ ignore_errors = true
[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
commit_parser = "conventional"

[tool.semantic_release.branches.main]
match = "main"
Loading