Skip to content

Commit a208bad

Browse files
committed
Release from GitHub Actions
1 parent 8de03f7 commit a208bad

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and upload to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
jobs:
14+
build:
15+
name: Build source distribution
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
22+
- name: Build
23+
run: pipx run build
24+
25+
- uses: actions/upload-artifact@v3
26+
with:
27+
path: |
28+
dist/*.tar.gz
29+
dist/*.whl
30+
31+
upload_pypi:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
environment: release
35+
permissions:
36+
id-token: write
37+
if: github.event_name == 'release' && github.event.action == 'published'
38+
steps:
39+
- uses: actions/download-artifact@v3
40+
with:
41+
name: artifact
42+
path: dist
43+
44+
- uses: pypa/gh-action-pypi-publish@release/v1

dev-bin/release.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ if [ -n "$(git status --porcelain)" ]; then
3333
exit 1
3434
fi
3535

36-
# Make sure Sphinx and wheel are installed with the current python
37-
pip install sphinx wheel
38-
3936
perl -pi -e "s/(?<=__version__ = \").+?(?=\")/$version/gsm" geoip2/__init__.py
4037
perl -pi -e "s/(?<=^version = \").+?(?=\")/$version/gsm" pyproject.toml
4138

@@ -62,8 +59,3 @@ git push
6259
gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag"
6360

6461
git push --tags
65-
66-
rm -fr build dist
67-
python -m sphinx -M html ./docs ./build/sphinx
68-
python -m pipx run build
69-
twine upload dist/*

0 commit comments

Comments
 (0)