This repository was archived by the owner on Aug 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +42
-16
lines changed Expand file tree Collapse file tree 3 files changed +42
-16
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Publish
3
+
4
+ on :
5
+ push :
6
+ tags :
7
+ - ' *'
8
+
9
+ jobs :
10
+ publish :
11
+ name : " Publish release"
12
+ runs-on : " ubuntu-latest"
13
+
14
+ steps :
15
+ - uses : " actions/checkout@v2"
16
+ - uses : " actions/setup-python@v1"
17
+ with :
18
+ python-version : 3.7
19
+ - name : " Publish"
20
+ run : " scripts/publish"
21
+ env :
22
+ TWINE_USERNAME : __token__
23
+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
Original file line number Diff line number Diff line change 2
2
name : Test Suite
3
3
4
4
on :
5
- push :
6
- branches : ["master"]
7
5
pull_request :
8
6
branches : ["master"]
9
7
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -e
2
2
3
- export VERSION=` cat databases/__init__.py | grep __version__ | sed " s/__version__ = //" | sed " s/'//g" `
4
- export PREFIX=" "
3
+ VERSION_FILE=" httpcore/__init__.py"
4
+ PYTHONPATH=.
5
+
5
6
if [ -d ' venv' ] ; then
6
- export PREFIX=" venv/bin/"
7
+ PREFIX=" venv/bin/"
8
+ else
9
+ PREFIX=" "
7
10
fi
8
11
9
- scripts/clean
12
+ if [ ! -z " $GITHUB_ACTIONS " ]; then
13
+ git config --local user.email " 41898282+github-actions[bot]@users.noreply.github.com"
14
+ git config --local user.name " GitHub Action"
15
+
16
+ VERSION=` grep __version__ ${VERSION_FILE} | grep -o ' [0-9][^"]*' `
10
17
11
- if ! command -v " ${PREFIX} twine" & > /dev/null ; then
12
- echo " Unable to find the 'twine' command."
13
- echo " Install from PyPI, using '${PREFIX} pip install twine'."
18
+ if [ " refs/tags/${VERSION} " != " ${GITHUB_REF} " ] ; then
19
+ echo " GitHub Ref '${GITHUB_REF} ' did not match package version '${VERSION} '"
14
20
exit 1
21
+ fi
15
22
fi
16
23
17
- ${PREFIX} python setup.py sdist
18
- ${PREFIX} twine upload dist/*
24
+ set -x
19
25
20
- echo " You probably want to also tag the version now:"
21
- echo " git tag -a ${VERSION} -m 'version ${VERSION} '"
22
- echo " git push --tags"
23
-
24
- scripts/clean
26
+ ${PREFIX} pip install twine wheel mkdocs mkdocs-material mkautodoc
27
+ ${PREFIX} python setup.py sdist bdist_wheel
28
+ ${PREFIX} twine upload dist/*
29
+ ${PREFIX} mkdocs gh-deploy --force
You can’t perform that action at this time.
0 commit comments