From f9baead9edcd75a99e9e03b6f564fcef00587609 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 4 Jun 2024 11:33:38 +0300 Subject: [PATCH 01/11] use flit --- .github/workflows/publish.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f80042d247f..4ffafc85043 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,18 +24,17 @@ 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/ + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }} + release: name: Create release From b01db16bad619cd0468b2377bf56a4ec8b3046f9 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 4 Jun 2024 12:04:57 +0300 Subject: [PATCH 02/11] update build configuration --- .github/workflows/build.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df6d65f1db8..2d208589989 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,28 +2,31 @@ 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: - name: Validate code accuracy + build: runs-on: ubuntu-latest + timeout-minutes: 40 + strategy: + max-parallel: 5 + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - - name: Lint with Pylint - run: pylint msgraph --disable=W --rcfile=.pylintrc + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + + - name: Lint with Pylint + run: pylint msgraph --disable=W --rcfile=.pylintrc From 1bacfdddfe8055533b499ad37b3dee6e9dd86339 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 4 Jun 2024 14:04:04 +0300 Subject: [PATCH 03/11] update version in toml --- .github/workflows/publish.yml | 42 ++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ffafc85043..ab654bd4dc5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,38 @@ 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@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - 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" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + build: + needs: [version] uses: ./.github/workflows/build.yml publish: @@ -20,11 +51,11 @@ jobs: needs: [build] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v2 with: - python-version: 3.12 + python-version: 3.9 - name: Install flit run: | pip install flit @@ -33,8 +64,7 @@ jobs: env: FLIT_INDEX_URL: https://upload.pypi.org/legacy/ FLIT_USERNAME: __token__ - FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }} - + FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} release: name: Create release @@ -42,7 +72,7 @@ jobs: needs: [publish] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v2 - name: Extract release notes id: extract-release-notes uses: ffurrer2/extract-release-notes@v2 From 82cbbafad3224fac14d50ac66b3863bfcf07c7b2 Mon Sep 17 00:00:00 2001 From: Shem Ogumbe Date: Wed, 5 Jun 2024 11:52:43 +0300 Subject: [PATCH 04/11] Update .github/workflows/publish.yml Co-authored-by: Andrew Omondi --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ab654bd4dc5..d1a31fb6266 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -51,7 +51,7 @@ jobs: needs: [build] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v2 with: From 44d62e27a00f746b4e553ad8e006ae2e4b4bb9bd Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Wed, 5 Jun 2024 12:10:13 +0300 Subject: [PATCH 05/11] update version --- .github/workflows/publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ab654bd4dc5..a31b1cbebfe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,9 +15,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install poetry @@ -51,9 +51,9 @@ jobs: needs: [build] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install flit @@ -72,7 +72,7 @@ jobs: needs: [publish] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Extract release notes id: extract-release-notes uses: ffurrer2/extract-release-notes@v2 From f567a92814cc6bdf577aed7d7446d84771954095 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Thu, 6 Jun 2024 12:20:34 +0300 Subject: [PATCH 06/11] update configs --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d208589989..26a480e0a47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,8 @@ on: workflow_call: jobs: - build: + validate: + name: Validate code accuracy runs-on: ubuntu-latest timeout-minutes: 40 strategy: From c7a2bf6e6961fafdea3a04f9056f9671b5518042 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Wed, 12 Jun 2024 12:51:05 +0300 Subject: [PATCH 07/11] use latest python version --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a31b1cbebfe..154bc0cb18d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,7 +55,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.12 - name: Install flit run: | pip install flit From 6f4a1da934c438ea5362483bb8f04b93c34bd62c Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Wed, 12 Jun 2024 12:52:45 +0300 Subject: [PATCH 08/11] use latest python version when for dependencies --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 154bc0cb18d..379d41bf15d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.12 - name: Install poetry run: | pip install --upgrade poetry From 7d83836c30482cf6d95b3e007ac8d12e15050811 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Wed, 12 Jun 2024 13:10:09 +0300 Subject: [PATCH 09/11] update validate code accuracy job --- .github/workflows/build.yml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26a480e0a47..da6fe19f7a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,22 +12,16 @@ jobs: validate: name: Validate code accuracy runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - max-parallel: 5 - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + - name: Lint with Pylint + run: pylint msgraph --disable=W --rcfile=.pylintrc - - name: Lint with Pylint - run: pylint msgraph --disable=W --rcfile=.pylintrc From aa07515cb2e51b423ce66317e8f325c7fe1cbca0 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Wed, 12 Jun 2024 13:14:31 +0300 Subject: [PATCH 10/11] fix indentation --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da6fe19f7a2..6b935e96648 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: workflow_call: jobs: - validate: + validate: name: Validate code accuracy runs-on: ubuntu-latest steps: From cd699f352466bc2b475fd224ab905d181e4cde17 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Wed, 12 Jun 2024 16:29:04 +0300 Subject: [PATCH 11/11] remove git push block --- .github/workflows/publish.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 379d41bf15d..ba4ecdbd8e7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,12 +32,8 @@ jobs: git config --local user.email "${{ secrets.GIT_USER_EMAIL }}" git config --local user.name "${{ secrets.GIT_USER_NAME }}" git commit -am "Update version" - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} + git push origin ${{ github.ref }} + build: needs: [version]