Skip to content

Commit 677f579

Browse files
chore: initialize SDK release history
0 parents  commit 677f579

3 files changed

Lines changed: 171 additions & 0 deletions

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release Please
2+
3+
# `next` accumulates validated SDK changes in one versioned PR to `main`.
4+
# Merging that PR creates the GitHub release; the package publishing workflow
5+
# runs from the release event.
6+
on:
7+
push:
8+
branches:
9+
- next
10+
- main
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: release-please
17+
cancel-in-progress: false
18+
19+
jobs:
20+
release-please:
21+
if: github.repository == 'kernel/hypeman-python'
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Mint release token
26+
id: release-token
27+
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1
28+
with:
29+
app-id: ${{ secrets.ADMIN_APP_ID }}
30+
private-key: ${{ secrets.ADMIN_APP_PRIVATE_KEY }}
31+
owner: kernel
32+
repositories: hypeman-python
33+
permission-contents: write
34+
permission-issues: write
35+
permission-pull-requests: write
36+
permission-workflows: write
37+
38+
- name: Set up Node
39+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
40+
with:
41+
node-version: '18.20.2'
42+
43+
- name: Set up pnpm
44+
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
45+
with:
46+
version: '9.11.0'
47+
run_install: false
48+
49+
- name: Build pinned release tooling
50+
id: tooling
51+
env:
52+
RELEASE_PLEASE_DIR: ${{ runner.temp }}/release-please
53+
RELEASE_PLEASE_SHA: a116e1e520e0f87824acf46a2e79c91d41e819d7
54+
run: |
55+
set -euo pipefail
56+
rm -rf "$RELEASE_PLEASE_DIR"
57+
git init "$RELEASE_PLEASE_DIR"
58+
git -C "$RELEASE_PLEASE_DIR" remote add origin https://github.com/stainless-api/release-please.git
59+
git -C "$RELEASE_PLEASE_DIR" fetch --depth=1 origin "$RELEASE_PLEASE_SHA"
60+
git -C "$RELEASE_PLEASE_DIR" checkout --detach FETCH_HEAD
61+
pnpm --dir "$RELEASE_PLEASE_DIR" install --frozen-lockfile
62+
pnpm --dir "$RELEASE_PLEASE_DIR" build
63+
echo "cli=$RELEASE_PLEASE_DIR/build/src/bin/release-please.js" >> "$GITHUB_OUTPUT"
64+
65+
- name: Open or update the release PR
66+
if: github.ref_name == 'next'
67+
env:
68+
GH_TOKEN: ${{ steps.release-token.outputs.token }}
69+
RELEASE_PLEASE: ${{ steps.tooling.outputs.cli }}
70+
run: |
71+
set -euo pipefail
72+
node "$RELEASE_PLEASE" release-pr \
73+
--repo-url "$GITHUB_REPOSITORY" \
74+
--token "$GH_TOKEN" \
75+
--target-branch main \
76+
--changes-branch next
77+
78+
- name: Remove the legacy promotion PR
79+
if: github.ref_name == 'next'
80+
env:
81+
GH_TOKEN: ${{ steps.release-token.outputs.token }}
82+
run: |
83+
set -euo pipefail
84+
legacy=$(gh pr list --repo "$GITHUB_REPOSITORY" --head stainless/release \
85+
--state open --json number --jq '.[].number')
86+
for pr in $legacy; do
87+
gh pr close "$pr" --repo "$GITHUB_REPOSITORY" \
88+
--comment "Superseded by the versioned release PR from next to main."
89+
done
90+
gh api -X DELETE "repos/$GITHUB_REPOSITORY/git/refs/heads/stainless/release" >/dev/null 2>&1 || true
91+
92+
- name: Create the GitHub release
93+
if: github.ref_name == 'main'
94+
env:
95+
GH_TOKEN: ${{ steps.release-token.outputs.token }}
96+
RELEASE_PLEASE: ${{ steps.tooling.outputs.cli }}
97+
run: |
98+
set -euo pipefail
99+
node "$RELEASE_PLEASE" github-release \
100+
--repo-url "$GITHUB_REPOSITORY" \
101+
--token "$GH_TOKEN" \
102+
--target-branch main

‎.release-please-manifest.json‎

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

‎release-please-config.json‎

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

0 commit comments

Comments
 (0)