Skip to content

Commit a1bf84a

Browse files
authored
Release pipeline (#211)
1 parent 13aefd3 commit a1bf84a

File tree

4 files changed

+89
-14
lines changed

4 files changed

+89
-14
lines changed

.github/workflows/cd.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: cd
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
run:
9+
name: release
10+
11+
permissions:
12+
id-token: write
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: install uv
20+
uses: astral-sh/setup-uv@v5
21+
with:
22+
version: 0.5.23
23+
24+
- name: set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.10"
28+
29+
- name: build library
30+
run: uv build
31+
32+
- name: push build artifacts to PyPI
33+
uses: pypa/[email protected]

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,45 +28,45 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030

31-
- name: Install uv
31+
- name: install uv
3232
uses: astral-sh/setup-uv@v5
3333
with:
3434
version: 0.5.23
3535

36-
- name: Set up python
36+
- name: set up python
3737
uses: actions/setup-python@v5
3838
with:
3939
python-version: ${{matrix.python-version}}
4040

41-
- name: Install
41+
- name: install
4242
run: uv sync --dev
4343

44-
- name: Check linting
44+
- name: check linting
4545
run: uv run ruff check
4646

47-
- name: Check types
47+
- name: check types
4848
run: uv run pyright
4949

50-
- name: Set up go
50+
- name: set up go
5151
uses: actions/setup-go@v5
5252
with:
53-
go-version: '1.23.0'
53+
go-version: "1.23.0"
5454

55-
- name: Checkout resonate repository
55+
- name: checkout resonate repository
5656
uses: actions/checkout@v4
5757
with:
5858
repository: resonatehq/resonate
5959
path: server
6060

61-
- name: Build resonate
61+
- name: build resonate
6262
run: go build -o resonate
6363
working-directory: server
6464

65-
- name: Start resonate server
65+
- name: start resonate server
6666
run: ./resonate serve --system-signal-timeout 0.1s &
6767
working-directory: server
6868

69-
- name: Run tests
69+
- name: run tests
7070
env:
7171
RESONATE_HOST: http://localhost
7272
run: uv run pytest tests

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ description = "Distributed Async Await by Resonate HQ, Inc"
55
readme = "README.md"
66
authors = [{ name = "Resonate HQ, Inc", email = "[email protected]" }]
77
requires-python = ">=3.12"
8-
dependencies = [
9-
"requests>=2.32.3",
10-
]
8+
dependencies = ["requests>=2.32.3"]
9+
10+
[project.urls]
11+
Documentation = "https://github.com/resonatehq/resonate-sdk-py#readme"
12+
Issues = "https://github.com/resonatehq/resonate-sdk-py/issues"
13+
Source = "https://github.com/resonatehq/resonate-sdk-py"
1114

1215
[build-system]
1316
requires = ["hatchling"]

scripts/new-release.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""New release."""
2+
3+
from __future__ import annotations
4+
5+
import pathlib
6+
import tomllib
7+
import webbrowser
8+
from typing import Any
9+
from urllib.parse import urlencode
10+
11+
12+
def project_project(cwd: pathlib.Path) -> dict[str, Any]:
13+
"""Read `pyproject.toml` project."""
14+
pyproject = tomllib.loads(
15+
cwd.joinpath(
16+
"pyproject.toml",
17+
).read_text(encoding="utf-8"),
18+
)
19+
20+
return pyproject["project"]
21+
22+
23+
def main() -> None:
24+
"""Prepare new release."""
25+
cwd = pathlib.Path().cwd()
26+
project = project_project(cwd=cwd)
27+
version = project["version"]
28+
source = project["urls"]["Source"]
29+
params = urlencode(
30+
query={
31+
"title": f"v{version}",
32+
"tag": f"v{version}",
33+
},
34+
)
35+
webbrowser.open_new_tab(url=f"{source}/releases/new?{params}")
36+
37+
38+
if __name__ == "__main__":
39+
main()

0 commit comments

Comments
 (0)