Skip to content

Commit fdd654d

Browse files
sentry fork
1 parent f3fa5d0 commit fdd654d

File tree

7 files changed

+89
-53
lines changed

7 files changed

+89
-53
lines changed

.craft.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
minVersion: 0.34.0
2+
targets:
3+
- name: pypi
4+
- name: github
5+
- name: sentry-pypi
6+
internalPypiRepo: getsentry/pypi

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, release/**, test-me-*]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.x
16+
- run: |
17+
set -x
18+
pip install build
19+
python -m build
20+
# TODO: we don't yet need an ext fork
21+
# cd ext
22+
# python -m build --outdir ../dist
23+
- uses: actions/upload-artifact@v4
24+
with:
25+
name: ${{ github.sha }}
26+
path: dist/*

.github/workflows/release.yml

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,34 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
6-
7-
concurrency:
8-
group: release-${{ github.event.release.tag_name }}
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version to release
8+
required: true
9+
merge_target:
10+
description: Target branch to merge into. Uses the default branch as a fallback (optional)
11+
required: true
912

1013
jobs:
11-
build-and-publish-ext:
14+
release:
1215
runs-on: ubuntu-latest
13-
environment:
14-
name: release-ext
15-
url: https://pypi.org/p/django-stubs-ext
16-
permissions:
17-
id-token: write
16+
name: "Release a new version"
1817
steps:
19-
- name: Setup python to build package
20-
uses: actions/setup-python@v6
18+
- name: Get auth token
19+
id: token
20+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
2121
with:
22-
python-version: '3.12'
23-
- name: Install build
24-
run: python -m pip install build
25-
- uses: actions/checkout@v5
22+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
23+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
24+
- uses: actions/checkout@v4
2625
with:
26+
token: ${{ steps.token.outputs.token }}
2727
fetch-depth: 0
28-
- name: Build ext package
29-
run: python -m build ext/
30-
- name: Publish ext to PyPI
31-
uses: pypa/[email protected]
28+
- name: Prepare release
29+
uses: getsentry/action-prepare-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
3232
with:
33-
packages-dir: ext/dist/
34-
35-
build-and-publish:
36-
runs-on: ubuntu-latest
37-
needs: [build-and-publish-ext]
38-
environment:
39-
name: release
40-
url: https://pypi.org/p/django-stubs
41-
permissions:
42-
id-token: write
43-
steps:
44-
- name: Setup python to build package
45-
uses: actions/setup-python@v6
46-
with:
47-
python-version: '3.12'
48-
- name: Install build
49-
run: python -m pip install build
50-
- uses: actions/checkout@v5
51-
with:
52-
fetch-depth: 0
53-
- name: Build package
54-
run: python -m build
55-
- name: Publish to PyPI
56-
uses: pypa/[email protected]
33+
version: ${{ github.event.inputs.version }}
34+
merge_target: ${{ github.event.inputs.merge_target }}

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
sentry-forked-django-stubs
2+
==========================
3+
4+
### new release
5+
6+
make a new branch for the fork of an upstream tag:
7+
8+
```bash
9+
git remote add upstream [email protected]:typeddjango/django-stubs
10+
git fetch upstream --tags
11+
git push origin --tags
12+
git checkout 1.2.3 -b sentry-1.2.3
13+
```
14+
15+
- cherry-pick the craft / release commit(s) into your branch from `master`
16+
- cherry-pick relevant commit(s) from previous releases
17+
18+
releases are done through craft in the release.yml workflow -- make sure to
19+
target your particular branch with a `.#` release postfix (like `1.2.3.0`)
20+
21+
___
22+
123
<img src="https://raw.githubusercontent.com/typeddjango/django-stubs/master/logo.svg" alt="django-stubs">
224

325
[![test](https://github.com/typeddjango/django-stubs/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/typeddjango/django-stubs/actions/workflows/test.yml)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "django-stubs"
6+
name = "sentry-forked-django-stubs"
77
version = "5.2.5"
88
description = "Mypy stubs for Django"
99
readme = "README.md"

scripts/bump-version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euxo pipefail
3+
4+
sed -i "s/^version = "'"'".*"'"'"$/version = "'"'"$2"'"'"/" pyproject.toml

uv.lock

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

0 commit comments

Comments
 (0)