Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ name: Build and validate generated code

on:
workflow_dispatch:
workflow_call:
push:
branches: [ main ]
pull_request:
branches: [ main, dev ]

permissions:
contents: read
workflow_call:

jobs:
validate:
Expand All @@ -27,3 +24,4 @@ jobs:
pip install -r requirements-dev.txt
- name: Lint with Pylint
run: pylint msgraph --disable=W --rcfile=.pylintrc

47 changes: 36 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,34 @@ permissions:
contents: write

jobs:
version:
name: Update version
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install poetry
run: |
pip install --upgrade poetry
- name: Update version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
poetry version $VERSION
- name: Commit changes
run: |
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
git commit -am "Update version"
git push origin ${{ github.ref }}


build:
needs: [version]
uses: ./.github/workflows/build.yml

publish:
Expand All @@ -24,18 +51,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
python-version: 3.12
- name: Install flit
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
Comment thread
shemogumbe marked this conversation as resolved.
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

release:
name: Create release
Expand Down