From b431663fafa9ef6d2337468e8c358cbfde57c5a5 Mon Sep 17 00:00:00 2001 From: anthony sottile <103459774+asottile-sentry@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:55:43 -0400 Subject: [PATCH] sentry fork (#1) --- .craft.yml | 6 ++++++ .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ README.md | 22 ++++++++++++++++++++++ scripts/bump-version.sh | 8 ++++++++ setup.py | 2 +- 6 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .craft.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml create mode 100755 scripts/bump-version.sh diff --git a/.craft.yml b/.craft.yml new file mode 100644 index 0000000000..cbbb53e47c --- /dev/null +++ b/.craft.yml @@ -0,0 +1,6 @@ +minVersion: 0.34.0 +targets: +- name: pypi +- name: github +- name: sentry-pypi + internalPypiRepo: getsentry/pypi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..539c32281e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: build + +on: + pull_request: + push: + branches: [main, release/**, test-me-*] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: | + set -x + pip install build + python -m build + # TODO: we don't yet need an ext fork + # cd ext + # python -m build --outdir ../dist + - uses: actions/upload-artifact@v3 + with: + name: ${{ github.sha }} + path: dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..6b49de1dbf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: Version to release + required: true + merge_target: + description: Target branch to merge into. Uses the default branch as a fallback (optional) + required: true + +jobs: + release: + runs-on: ubuntu-latest + name: "Release a new version" + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_RELEASE_PAT }} + fetch-depth: 0 + - name: Prepare release + uses: getsentry/action-prepare-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} + with: + version: ${{ github.event.inputs.version }} + merge_target: ${{ github.event.inputs.merge_target }} diff --git a/README.md b/README.md index c7cd38c1d6..4bf75bbd20 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ +sentry-forked-django-stubs +========================== + +### new release + +make a new branch for the fork of an upstream tag: + +```bash +git remote add upstream git@github.com:typeddjango/django-stubs +git fetch upstream --tags +git push origin --tags +git checkout 1.2.3 -b sentry-1.2.3 +``` + +- cherry-pick the craft / release commit(s) into your branch from `master` +- cherry-pick relevant commit(s) from previous releases + +releases are done through craft in the release.yml workflow -- make sure to +target your particular branch with a `+sentry#` release postfix + +___ + django-stubs [![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) diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh new file mode 100755 index 0000000000..d7c26edc28 --- /dev/null +++ b/scripts/bump-version.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euxo pipefail + +if ! grep -E '^.*\+sentry[0-9]+' <<< "$2"; then + : "version must be D.D.D+sentryD got: $2" + exit 1 +fi +sed -i "s/^ version="'"'".*"'"'",$/ version="'"'"$2"'"'",/" setup.py diff --git a/setup.py b/setup.py index 18bb048eba..8a59d5550c 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def find_stub_files(name: str) -> List[str]: } setup( - name="django-stubs", + name="sentry-forked-django-stubs", version="4.2.6", description="Mypy stubs for Django", long_description=readme,