File tree Expand file tree Collapse file tree 3 files changed +49
-28
lines changed
Expand file tree Collapse file tree 3 files changed +49
-28
lines changed Original file line number Diff line number Diff line change 1- name : Build and valiate SDK package
1+ name : Validate code accuracy
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 :
1613 name : Validate code accuracy
1714 runs-on : ubuntu-latest
18- steps :
19- - uses : actions/checkout@v4
20- - name : Set up Python
21- uses : actions/setup-python@v5
22- with :
23- python-version : ' 3.8'
24- - name : Install dependencies
25- run : |
26- python -m pip install --upgrade pip
27- pip install -r requirements-dev.txt
28- - name : Lint with Pylint
29- run : pylint msgraph_beta --disable=W --rcfile=.pylintrc
15+ steps :
16+ - uses : actions/checkout@v4
17+ - name : Set up Python
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : ' 3.12'
21+ - name : Install dependencies
22+ run : |
23+ python -m pip install --upgrade pip
24+ pip install -r requirements-dev.txt
25+
26+ - name : Lint with Pylint
27+ run : pylint msgraph_beta --disable=W --rcfile=.pylintrc
Original file line number Diff line number Diff line change @@ -9,7 +9,33 @@ 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 "chore: Update version"
35+ git push origin ${{ github.ref }}
36+
1237 build :
38+ needs : [version]
1339 uses : ./.github/workflows/build.yml
1440
1541 publish :
@@ -25,17 +51,15 @@ jobs:
2551 uses : actions/setup-python@v5
2652 with :
2753 python-version : 3.12
28- - name : Install dependencies
54+ - name : Install flit
2955 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@release/v1
36- with :
37- user : __token__
38- password : ${{ secrets.PYPI_API_TOKEN }}
56+ pip install flit
57+ - name : Publish the distibution to PyPI
58+ run : flit publish
59+ env :
60+ FLIT_INDEX_URL : https://upload.pypi.org/legacy/
61+ FLIT_USERNAME : __token__
62+ FLIT_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
3963
4064 release :
4165 name : Create release
Original file line number Diff line number Diff line change @@ -51,4 +51,3 @@ def me(self) -> UserItemRequestBuilder:
5151 url_tpl_parameters ["user%2Did" ] = "me-token-to-replace"
5252
5353 return UserItemRequestBuilder (self .request_adapter , url_tpl_parameters )
54-
You can’t perform that action at this time.
0 commit comments