Skip to content

Commit 8195af1

Browse files
sentry fork
1 parent 5118c5d commit 8195af1

File tree

6 files changed

+76
-42
lines changed

6 files changed

+76
-42
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@v3
24+
with:
25+
name: ${{ github.sha }}
26+
path: dist/*

.github/workflows/release.yml

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,28 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
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
612

713
jobs:
8-
build-and-publish:
9-
runs-on: ubuntu-latest
10-
environment:
11-
name: release
12-
url: https://pypi.org/p/django-stubs
13-
permissions:
14-
id-token: write
15-
steps:
16-
- name: Setup python to build package
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.12'
20-
- name: Install build
21-
run: python -m pip install build
22-
- uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
- name: Build package
26-
run: python -m build
27-
- name: Publish to PyPI
28-
uses: pypa/[email protected]
29-
30-
build-and-publish-ext:
14+
release:
3115
runs-on: ubuntu-latest
32-
environment:
33-
name: release-ext
34-
url: https://pypi.org/p/django-stubs-ext
35-
permissions:
36-
id-token: write
16+
name: "Release a new version"
3717
steps:
38-
- name: Setup python to build package
39-
uses: actions/setup-python@v5
40-
with:
41-
python-version: '3.12'
42-
- name: Install build
43-
run: python -m pip install build
4418
- uses: actions/checkout@v4
4519
with:
20+
token: ${{ secrets.GH_RELEASE_PAT }}
4621
fetch-depth: 0
47-
- name: Build ext package
48-
run: python -m build ext/
49-
- name: Publish ext to PyPI
50-
uses: pypa/[email protected]
22+
- name: Prepare release
23+
uses: getsentry/action-prepare-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
5126
with:
52-
packages-dir: ext/dist/
27+
version: ${{ github.event.inputs.version }}
28+
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
[![Build status](https://github.com/typeddjango/django-stubs/workflows/test/badge.svg?branch=master&event=push)](https://github.com/typeddjango/django-stubs/actions?query=workflow%3Atest)

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"'"'",/" setup.py

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def find_stub_files(name: str) -> List[str]:
3838
}
3939

4040
setup(
41-
name="django-stubs",
41+
name="sentry-forked-django-stubs",
4242
version="5.0.2",
4343
description="Mypy stubs for Django",
4444
long_description=readme,

0 commit comments

Comments
 (0)