File tree Expand file tree Collapse file tree 2 files changed +38
-15
lines changed
Expand file tree Collapse file tree 2 files changed +38
-15
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,11 @@ name: Build and validate generated code
22
33on :
44 workflow_dispatch :
5- workflow_call :
65 push :
76 branches : [ main ]
87 pull_request :
98 branches : [ main, dev ]
10-
11- permissions :
12- contents : read
9+ workflow_call :
1310
1411jobs :
1512 validate :
2724 pip install -r requirements-dev.txt
2825 - name : Lint with Pylint
2926 run : pylint msgraph --disable=W --rcfile=.pylintrc
27+
Original file line number Diff line number Diff line change @@ -9,7 +9,34 @@ permissions:
99 contents : write
1010
1111jobs :
12+ version :
13+ name : Update version
14+ runs-on : ubuntu-latest
15+ if : startsWith(github.ref, 'refs/tags/v')
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+ - name : Set up Python
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : 3.12
23+ - name : Install poetry
24+ run : |
25+ pip install --upgrade poetry
26+ - name : Update version
27+ run : |
28+ VERSION=${GITHUB_REF#refs/tags/v}
29+ poetry version $VERSION
30+ - name : Commit changes
31+ run : |
32+ git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
33+ git config --local user.name "${{ secrets.GIT_USER_NAME }}"
34+ git commit -am "Update version"
35+ git push origin ${{ github.ref }}
36+
37+
1238 build :
39+ needs : [version]
1340 uses : ./.github/workflows/build.yml
1441
1542 publish :
@@ -24,18 +51,16 @@ jobs:
2451 - name : Set up Python
2552 uses : actions/setup-python@v5
2653 with :
27- python-version : ' 3.12'
28- - name : Install dependencies
54+ python-version : 3.12
55+ - name : Install flit
2956 run : |
30- python -m pip install --upgrade pip
31- pip install build
32- - name : Build package
33- run : python -m build
34- - name : Publish package
35- uses : pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
36- with :
37- user : __token__
38- password : ${{ secrets.PYPI_API_TOKEN }}
57+ pip install flit
58+ - name : Publish the distibution to PyPI
59+ run : flit publish
60+ env :
61+ FLIT_INDEX_URL : https://upload.pypi.org/legacy/
62+ FLIT_USERNAME : __token__
63+ FLIT_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
3964
4065 release :
4166 name : Create release
You can’t perform that action at this time.
0 commit comments