Skip to content

Commit 97c72b0

Browse files
Setting up publish & release actions.
1 parent 2701059 commit 97c72b0

File tree

5 files changed

+148
-3
lines changed

5 files changed

+148
-3
lines changed

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: Build distributions
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Set up uv
26+
uses: astral-sh/setup-uv@v6
27+
28+
- name: Build package
29+
run: uv build
30+
31+
- name: Validate distributions
32+
run: uvx twine check --strict dist/*
33+
34+
- name: Upload distributions
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: python-package-distributions
38+
path: dist/
39+
if-no-files-found: error
40+
41+
publish:
42+
name: Publish to PyPI
43+
needs: build
44+
runs-on: ubuntu-latest
45+
permissions:
46+
id-token: write
47+
48+
steps:
49+
- name: Download distributions
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
55+
- name: Publish package
56+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Create GitHub Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
release:
11+
name: Create release from package version
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Ensure workflow runs from main
21+
run: |
22+
if [ "${{ github.ref_name }}" != "main" ]; then
23+
echo "This workflow must be run from the main branch."
24+
exit 1
25+
fi
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.12"
31+
32+
- name: Set up uv
33+
uses: astral-sh/setup-uv@v6
34+
35+
- name: Read version from pyproject
36+
run: |
37+
VERSION="$(python - <<'PY'
38+
import tomllib
39+
from pathlib import Path
40+
41+
data = tomllib.loads(Path("pyproject.toml").read_text())
42+
print(data["project"]["version"])
43+
PY
44+
)"
45+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
46+
echo "TAG=v$VERSION" >> "$GITHUB_ENV"
47+
48+
- name: Ensure release tag does not already exist
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
run: |
52+
if gh release view "$TAG" >/dev/null 2>&1; then
53+
echo "Release $TAG already exists."
54+
exit 1
55+
fi
56+
57+
- name: Build package
58+
run: uv build
59+
60+
- name: Validate distributions
61+
run: uvx twine check --strict dist/*
62+
63+
- name: Create GitHub release
64+
env:
65+
GH_TOKEN: ${{ github.token }}
66+
run: |
67+
gh release create "$TAG" \
68+
--title "$TAG" \
69+
--generate-notes \
70+
--target "${{ github.sha }}"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Backend-agnostic schema generation for [Strawberry GraphQL](https://strawberry.rocks/) on top of Django ORM, SQLAlchemy, and Tortoise ORM.
44

5+
> **WARNING**
6+
> `strawberry-orm` is still in **alpha**. Expect breaking changes, incomplete APIs, and release-to-release churn while the package stabilizes.
7+
58
`strawberry-orm` helps you keep one Strawberry schema style across multiple ORMs. It focuses on:
69

710
- model-backed Strawberry types

pyproject.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
[project]
22
name = "strawberry-orm"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "Unified, backend-agnostic ORM abstraction for Strawberry GraphQL"
55
readme = "README.md"
66
license = "MIT"
77
authors = [
8+
{ name = "James Davidson", email = "jamie.t.davidson@gmail.com" },
89
{ name = "Patrick Arminio", email = "patrick.arminio@gmail.com" }
910
]
1011
requires-python = ">=3.10"
12+
classifiers = [
13+
"Development Status :: 3 - Alpha",
14+
"License :: OSI Approved :: MIT License",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3 :: Only",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Topic :: Software Development :: Libraries :: Python Modules",
21+
]
1122
dependencies = [
1223
"strawberry-graphql>=0.311.0",
1324
]
1425

26+
[project.urls]
27+
Homepage = "https://github.com/strawberry-graphql/strawberry-orm"
28+
Repository = "https://github.com/strawberry-graphql/strawberry-orm"
29+
Issues = "https://github.com/strawberry-graphql/strawberry-orm/issues"
30+
1531
[project.optional-dependencies]
1632
django = ["django>=4.2"]
1733
sqlalchemy = ["sqlalchemy>=2.0"]

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)