Skip to content

Commit 2b1af52

Browse files
authored
Merge pull request #129 from maxmind/greg/release-from-action
Release from GitHub Action
2 parents 6067750 + 7ae437f commit 2b1af52

File tree

3 files changed

+62
-31
lines changed

3 files changed

+62
-31
lines changed

.github/workflows/create-wheels.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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_wheels:
15+
name: Build wheels on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [macos-latest, ubuntu-latest, windows-latest]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: true
25+
26+
- name: Build wheels
27+
uses: pypa/cibuildwheel@v2.16.2
28+
env:
29+
CIBW_BUILD_VERBOSITY: 1
30+
MAXMINDDB_REQUIRE_EXTENSION: 1
31+
32+
- uses: actions/upload-artifact@v3
33+
with:
34+
path: ./wheelhouse/*.whl
35+
36+
build_sdist:
37+
name: Build source distribution
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Build sdist
43+
run: pipx run build --sdist
44+
45+
- uses: actions/upload-artifact@v3
46+
with:
47+
path: dist/*.tar.gz
48+
49+
upload_pypi:
50+
needs: [build_wheels, build_sdist]
51+
runs-on: ubuntu-latest
52+
environment: release
53+
permissions:
54+
id-token: write
55+
if: github.event_name == 'release' && github.event.action == 'published'
56+
steps:
57+
- uses: actions/download-artifact@v3
58+
with:
59+
name: artifact
60+
path: dist
61+
62+
- uses: pypa/gh-action-pypi-publish@release/v1

dev-bin/release.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,3 @@ git push
6363
gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag"
6464

6565
git push --tags
66-
67-
rm -fr build dist
68-
python -m sphinx -M html ./docs ./build/sphinx -W
69-
python setup.py sdist
70-
twine upload dist/*

0 commit comments

Comments
 (0)