Skip to content

Commit 0781a12

Browse files
authored
Add release workflow (#42)
* Add release workflow * Update README.md
1 parent 8b2ed8b commit 0781a12

File tree

3 files changed

+50
-8
lines changed

3 files changed

+50
-8
lines changed

.github/workflows/release.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Release'
2+
3+
on:
4+
- workflow_dispatch
5+
6+
jobs:
7+
release:
8+
name: Publish release
9+
runs-on: ubuntu-20.04
10+
env:
11+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
12+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
13+
steps:
14+
- name: Checkout the repository
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
23+
- name: Detect version
24+
run: echo "REPO_VERSION=$(python3 posthog/version.py)" >> $GITHUB_ENV
25+
26+
- name: Push release to PyPI
27+
run: make analytics && make release_analytics
28+
29+
- name: Create GitHub release
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
33+
with:
34+
tag_name: v${{ env.REPO_VERSION }}
35+
release_name: ${{ env.REPO_VERSION }}

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,20 @@ Please see the main [PostHog docs](https://posthog.com/docs).
66

77
Specifically, the [Python integration](https://posthog.com/docs/integrations/python-integration) details.
88

9-
## Questions?
10-
11-
### [Join our Slack community.](https://join.slack.com/t/posthogusers/shared_invite/enQtOTY0MzU5NjAwMDY3LTc2MWQ0OTZlNjhkODk3ZDI3NDVjMDE1YjgxY2I4ZjI4MzJhZmVmNjJkN2NmMGJmMzc2N2U3Yjc3ZjI5NGFlZDQ)
9+
## Development
1210

13-
# Local Development
14-
15-
## Testing Locally
11+
### Testing Locally
1612

1713
1. Run `python3 -m venv env` (creates virtual environment called "env")
1814
2. Run `source env/bin/activate` (activates the virtual environment)
1915
3. Run `python3 -m pip install -e ".[test]"` (installs the package in develop mode, along with test dependencies)
2016
4. Run `make test`
2117

22-
## Running Locally
18+
### Running Locally
2319

2420
Assuming you have a [local version of PostHog](https://posthog.com/docs/developing-locally) running, you can run `python3 example.py` to see the library in action.
2521

26-
## Running the Django Sentry Integration Locally
22+
### Running the Django Sentry Integration Locally
2723

2824
There's a sample Django project included, called `sentry_django_example`, which explains how to use PostHog with Sentry.
2925

@@ -40,3 +36,11 @@ There's 2 places of importance (Changes required are all marked with TODO in the
4036
To run things: `make django_example`. This installs the posthog-python library with the sentry-sdk add-on, and then runs the django app.
4137
Also start the PostHog app locally.
4238
Then navigate to `http://127.0.0.1:8080/sentry-debug/` and you should get an event in both Sentry and PostHog, with links to each other.
39+
40+
### Releasing Versions
41+
42+
Updated are released using GitHub Actions: after bumping `version.py` in `master`, go to [our release workflow's page](https://github.com/PostHog/http-mmdb/actions/workflows/release.yml) and dispatch it manually, using workflow from `master`.
43+
44+
## Questions?
45+
46+
### [Join our Slack community.](https://join.slack.com/t/posthogusers/shared_invite/enQtOTY0MzU5NjAwMDY3LTc2MWQ0OTZlNjhkODk3ZDI3NDVjMDE1YjgxY2I4ZjI4MzJhZmVmNjJkN2NmMGJmMzc2N2U3Yjc3ZjI5NGFlZDQ)

posthog/version.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
VERSION = "1.4.1"
2+
3+
if __name__ == "__main__":
4+
print(VERSION, end="")

0 commit comments

Comments
 (0)