Skip to content

Release pipeline #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
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
33 changes: 33 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: cd

on:
release:
types: [released]

jobs:
run:
name: release

permissions:
id-token: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.5.23

- name: set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: build library
run: uv build

- name: push build artifacts to PyPI
uses: pypa/[email protected]
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,45 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install uv
- name: install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.5.23

- name: Set up python
- name: set up python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}

- name: Install
- name: install
run: uv sync --dev

- name: Check linting
- name: check linting
run: uv run ruff check

- name: Check types
- name: check types
run: uv run pyright

- name: Set up go
- name: set up go
uses: actions/setup-go@v5
with:
go-version: '1.23.0'
go-version: "1.23.0"

- name: Checkout resonate repository
- name: checkout resonate repository
uses: actions/checkout@v4
with:
repository: resonatehq/resonate
path: server

- name: Build resonate
- name: build resonate
run: go build -o resonate
working-directory: server

- name: Start resonate server
- name: start resonate server
run: ./resonate serve --system-signal-timeout 0.1s &
working-directory: server

- name: Run tests
- name: run tests
env:
RESONATE_HOST: http://localhost
run: uv run pytest tests
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ description = "Distributed Async Await by Resonate HQ, Inc"
readme = "README.md"
authors = [{ name = "Resonate HQ, Inc", email = "[email protected]" }]
requires-python = ">=3.12"
dependencies = [
"requests>=2.32.3",
]
dependencies = ["requests>=2.32.3"]

[project.urls]
Documentation = "https://github.com/resonatehq/resonate-sdk-py#readme"
Issues = "https://github.com/resonatehq/resonate-sdk-py/issues"
Source = "https://github.com/resonatehq/resonate-sdk-py"

[build-system]
requires = ["hatchling"]
Expand Down
39 changes: 39 additions & 0 deletions scripts/new-release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""New release."""

from __future__ import annotations

import pathlib
import tomllib
import webbrowser
from typing import Any
from urllib.parse import urlencode


def project_project(cwd: pathlib.Path) -> dict[str, Any]:
"""Read `pyproject.toml` project."""
pyproject = tomllib.loads(
cwd.joinpath(
"pyproject.toml",
).read_text(encoding="utf-8"),
)

return pyproject["project"]


def main() -> None:
"""Prepare new release."""
cwd = pathlib.Path().cwd()
project = project_project(cwd=cwd)
version = project["version"]
source = project["urls"]["Source"]
params = urlencode(
query={
"title": f"v{version}",
"tag": f"v{version}",
},
)
webbrowser.open_new_tab(url=f"{source}/releases/new?{params}")


if __name__ == "__main__":
main()
Loading