File tree Expand file tree Collapse file tree 6 files changed +50
-51
lines changed
Expand file tree Collapse file tree 6 files changed +50
-51
lines changed Original file line number Diff line number Diff line change 88 name : build and publish to pypi
99 runs-on : ubuntu-latest
1010 steps :
11- - uses : actions/checkout@v2
12-
13- - name : Set version from tag
14- if : startsWith(github.ref, 'refs/tags')
15- run : |
16- # from refs/tags/1.2.3 get 1.2.3
17- VERSION=$( basename $GITHUB_REF )
18- PLACEHOLDER='__version__ = "0.0.0"'
19- VERSION_FILE='gwh/__version__.py'
20- # fail out if placeholder not found
21- grep "$PLACEHOLDER" "$VERSION_FILE"
22- sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/" "$VERSION_FILE"
23- shell : bash
11+ - uses : actions/checkout@v5
2412
2513 - name : install, test cli
2614 run : |
@@ -29,12 +17,12 @@ jobs:
2917
3018 - name : install dependencies & build
3119 run : |
32- pip3 install setuptools wheel
33- python3 setup.py sdist bdist_wheel
20+ pip3 install build
21+ python3 -m build
3422
3523 - name : publish to PyPi
3624 if : startsWith(github.ref, 'refs/tags')
3725 uses : pypa/gh-action-pypi-publish@release/v1
3826 with :
3927 user : __token__
40- password : ${{ secrets.PYPI_TOKEN }}
28+ password : ${{ secrets.PYPI_TOKEN }}
Original file line number Diff line number Diff line change 55 name : build and publish to testpypi
66 runs-on : ubuntu-latest
77 steps :
8- - uses : actions/checkout@v2
8+ - uses : actions/checkout@v5
99
1010 - name : install, test cli
1111 run : |
1414
1515 - name : install dependencies & build
1616 run : |
17- pip3 install setuptools wheel
18- python3 setup.py sdist bdist_wheel
17+ pip3 install build
18+ python3 -m build
1919
2020 - name : publish to Test PyPi
2121 uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 11import argparse
22import json
33
4- from .__version__ import (
5- __package__ ,
6- __version__
7- )
4+ from importlib .metadata import version , PackageNotFoundError
5+
6+ try :
7+ __version__ = version ("gwh" )
8+ except PackageNotFoundError :
9+ __version__ = "unknown"
10+
811from gwh import app
912import gwh
1013
11- if __name__ == "__main__" :
14+ def main () :
1215 parser = argparse .ArgumentParser (prog = "python -m gwh" , description = "GitLab webhook handler" )
1316 parser .add_argument ("config" , help = "path to repos configuration" )
1417 parser .add_argument ("--version" , action = "version" , version = __package__ + " " + __version__ )
3033 app .debug = args .debug
3134
3235 app .run (host = args .host , port = args .port )
36+
37+ if __name__ == "__main__" :
38+ main ()
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ [build-system ]
2+ requires = [" setuptools>=40.6.0" , " wheel" ]
3+ build-backend = " setuptools.build_meta"
4+
5+ [project ]
6+ name = " gwh"
7+ version = " 1.1.0"
8+ description = " Webhook Handler for GitLab"
9+ readme = " README.md"
10+ authors = [
11+ { name = " Andy Hebrank" , email = " ahebrank@gmail.com" }
12+ ]
13+ license = " Apache-2.0"
14+ requires-python = " >=3.8"
15+ dependencies = [
16+ " Flask>=1.0" ,
17+ " requests>=2.19.0"
18+ ]
19+
20+ [project .urls ]
21+ Homepage = " https://github.com/ahebrank/gitlab-webhook-handler"
22+ Repository = " https://github.com/ahebrank/gitlab-webhook-handler.git"
23+ Issues = " https://github.com/ahebrank/gitlab-webhook-handler/issues"
24+
25+ [tool .setuptools ]
26+ packages = [" gwh" ]
27+
28+ [tool .setuptools .package-data ]
29+ gwh = [" repos.json.example" ]
30+
31+ [project .scripts ]
32+ gwh = " gwh.__main__:main"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments