Skip to content

Commit 51aaa61

Browse files
release: 1.27.0 (#2)
1 parent 58bb98d commit 51aaa61

15 files changed

+260
-33
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Create releases
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
name: release
10+
if: github.ref == 'refs/heads/main' && github.repository == 'orbcorp/orb-python'
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: stainless-api/trigger-release-please@v1
17+
id: release
18+
with:
19+
repo: ${{ github.event.repository.full_name }}
20+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
21+
22+
- name: Install Rye
23+
if: ${{ steps.release.outputs.releases_created }}
24+
run: |
25+
curl -sSf https://rye-up.com/get | bash
26+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
27+
env:
28+
RYE_VERSION: 0.15.2
29+
RYE_INSTALL_OPTION: "--yes"
30+
31+
- name: Publish to PyPI
32+
if: ${{ steps.release.outputs.releases_created }}
33+
run: |
34+
bash ./bin/publish-pypi
35+
env:
36+
PYPI_TOKEN: ${{ secrets.ORB_PYPI_TOKEN || secrets.PYPI_TOKEN }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Handle release PR title edits
2+
on:
3+
pull_request:
4+
types:
5+
- edited
6+
- unlabeled
7+
8+
jobs:
9+
update_pr_content:
10+
name: Update pull request content
11+
if: |
12+
((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
13+
(github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) &&
14+
startsWith(github.event.pull_request.head.ref, 'release-please--') &&
15+
github.event.pull_request.state == 'open' &&
16+
github.event.sender.login != 'stainless-bot' &&
17+
github.repository == 'orbcorp/orb-python'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: stainless-api/trigger-release-please@v1
22+
with:
23+
repo: ${{ github.event.repository.full_name }}
24+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}

.github/workflows/publish-pypi.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# workflow for re-running publishing to PyPI in case it fails for some reason
2+
# you can run this workflow by navigating to https://www.github.com/orbcorp/orb-python/actions/workflows/publish-pypi.yml
3+
name: Publish PyPI
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Install Rye
16+
run: |
17+
curl -sSf https://rye-up.com/get | bash
18+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
19+
env:
20+
RYE_VERSION: 0.15.2
21+
RYE_INSTALL_OPTION: "--yes"
22+
23+
- name: Publish to PyPI
24+
run: |
25+
bash ./bin/publish-pypi
26+
env:
27+
PYPI_TOKEN: ${{ secrets.ORB_PYPI_TOKEN || secrets.PYPI_TOKEN }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release_doctor:
8+
name: release doctor
9+
runs-on: ubuntu-latest
10+
if: github.repository == 'orbcorp/orb-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Check release environment
16+
run: |
17+
bash ./bin/check-release-environment
18+
env:
19+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
20+
PYPI_TOKEN: ${{ secrets.ORB_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.27.0"
3+
}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
## 1.27.0 (2023-10-20)
4+
5+
Full Changelog: [v1.26.0...v1.27.0](https://github.com/orbcorp/orb-python/compare/v1.26.0...v1.27.0)
6+
7+
### Features
8+
9+
* **init:** initial commit ([33d4af6](https://github.com/orbcorp/orb-python/commit/33d4af66059edfeffd6b39f058867d1babfd8fa9))
10+
11+
12+
### Chores
13+
14+
* correct version ([58bb98d](https://github.com/orbcorp/orb-python/commit/58bb98df611c05e4b89fb5c2e4a1d7a99dbb312e))
15+
16+
17+
### Documentation
18+
19+
* improve code examples ([927512a](https://github.com/orbcorp/orb-python/commit/927512a8d90168348136c312527b816344ec3a88))

bin/check-release-environment

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
errors=()
4+
5+
if [ -z "${STAINLESS_API_KEY}" ]; then
6+
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
7+
fi
8+
9+
if [ -z "${PYPI_TOKEN}" ]; then
10+
errors+=("The ORB_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
11+
fi
12+
13+
len=${#errors[@]}
14+
15+
if [[ len -gt 0 ]]; then
16+
echo -e "Found the following errors in the release environment:\n"
17+
18+
for error in "${errors[@]}"; do
19+
echo -e "- $error\n"
20+
done
21+
22+
exit 1
23+
fi
24+
25+
echo "The environment is ready to push releases!"

bin/publish-pypi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
mkdir -p dist
5+
rye build --clean
6+
rye publish --yes --token=$PYPI_TOKEN

pyproject.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
[project]
22
name = "orb-billing"
3-
version = "1.26.0"
3+
version = "1.27.0"
44
description = "Client library for the orb API"
55
readme = "README.md"
66
license = "Apache-2.0"
77
authors = [
88
{ name = "Orb", email = "[email protected]" },
99
]
1010
dependencies = [
11-
"httpx>=0.23.0, <1",
12-
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.5, <5",
14-
"anyio>=3.5.0, <4",
15-
"distro>=1.7.0, <2",
16-
11+
"httpx>=0.23.0, <1",
12+
"pydantic>=1.9.0, <3",
13+
"typing-extensions>=4.5, <5",
14+
"anyio>=3.5.0, <4",
15+
"distro>=1.7.0, <2",
16+
1717
]
1818
requires-python = ">= 3.7"
1919

@@ -28,17 +28,17 @@ Repository = "https://github.com/orbcorp/orb-python"
2828
[tool.rye]
2929
managed = true
3030
dev-dependencies = [
31-
"pyright==1.1.326",
32-
"mypy==1.4.1",
33-
"black==23.3.0",
34-
"respx==0.19.2",
35-
"pytest==7.1.1",
36-
"pytest-asyncio==0.21.1",
37-
"ruff==0.0.282",
38-
"isort==5.10.1",
39-
"time-machine==2.9.0",
40-
"nox==2023.4.22",
41-
31+
"pyright==1.1.332",
32+
"mypy==1.6.1",
33+
"black==23.3.0",
34+
"respx==0.19.2",
35+
"pytest==7.1.1",
36+
"pytest-asyncio==0.21.1",
37+
"ruff==0.0.282",
38+
"isort==5.10.1",
39+
"time-machine==2.9.0",
40+
"nox==2023.4.22",
41+
4242
]
4343

4444
[tool.rye.scripts]

release-please-config.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"packages": {
3+
".": {}
4+
},
5+
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
6+
"include-v-in-tag": true,
7+
"include-component-in-tag": false,
8+
"bump-minor-pre-major": true,
9+
"bump-patch-for-minor-pre-major": false,
10+
"pull-request-header": "Automated Release PR",
11+
"pull-request-title-pattern": "release: ${version}",
12+
"changelog-sections": [
13+
{
14+
"type": "feat",
15+
"section": "Features"
16+
},
17+
{
18+
"type": "fix",
19+
"section": "Bug Fixes"
20+
},
21+
{
22+
"type": "perf",
23+
"section": "Performance Improvements"
24+
},
25+
{
26+
"type": "revert",
27+
"section": "Reverts"
28+
},
29+
{
30+
"type": "chore",
31+
"section": "Chores"
32+
},
33+
{
34+
"type": "docs",
35+
"section": "Documentation"
36+
},
37+
{
38+
"type": "style",
39+
"section": "Styles"
40+
},
41+
{
42+
"type": "refactor",
43+
"section": "Refactors"
44+
},
45+
{
46+
"type": "test",
47+
"section": "Tests",
48+
"hidden": true
49+
},
50+
{
51+
"type": "build",
52+
"section": "Build System"
53+
},
54+
{
55+
"type": "ci",
56+
"section": "Continuous Integration",
57+
"hidden": true
58+
}
59+
],
60+
"release-type": "python",
61+
"extra-files": [
62+
"src/orb/_version.py"
63+
]
64+
}

0 commit comments

Comments
 (0)