From 69f9a8c7cab013503e2c55be54cb5aa6344930f2 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Wed, 22 Nov 2023 18:07:17 -0800 Subject: [PATCH] Preparing MSAL Python EX 1.1.0 --- .github/workflows/python-package.yml | 19 +++++++++++++++---- Dockerfile | 4 ++-- msal_extensions/__init__.py | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8813e68..2d7b92f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -86,7 +86,16 @@ jobs: cd: needs: ci - if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master') + # Note: github.event.pull_request.draft == false WON'T WORK in "if" statement, + # because the triggered event is a push, not a pull_request. + # This means each commit will trigger a release on TestPyPI. + # Those releases will only succeed when each push has a new version number: a1, a2, a3, etc. + if: | + github.event_name == 'push' && + ( + startsWith(github.ref, 'refs/tags') || + startsWith(github.ref, 'refs/heads/release-') + ) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -98,14 +107,16 @@ jobs: run: | python -m pip install build --user python -m build --sdist --wheel --outdir dist/ . - - name: Publish to TestPyPI + - name: | + Publish to TestPyPI when pushing to release-* branch. + You better test with a1, a2, b1, b2 releases first. uses: pypa/gh-action-pypi-publish@v1.4.2 - if: github.ref == 'refs/heads/master' + if: startsWith(github.ref, 'refs/heads/release-') with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - - name: Publish to PyPI + - name: Publish to PyPI when tagged if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@v1.4.2 with: diff --git a/Dockerfile b/Dockerfile index a56a2ea..8b506dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # TODO: Can this Dockerfile use multi-stage build? # Final size 690MB. (It would be 1.16 GB if started with python:3 as base) -FROM python:3-slim +FROM python:3.12-slim # Install Generic PyGObject (sans GTK) #The following somehow won't work: @@ -22,7 +22,7 @@ RUN apt-get install -y \ RUN pip install "pytest>=6,<7" # Install MSAL Extensions. Upgrade the pinned version number to trigger a new image build. -RUN pip install "msal-extensions==0.3" +RUN pip install "msal-extensions==1.1" # This setup is inspired from https://github.com/jaraco/keyring#using-keyring-on-headless-linux-systems-in-a-docker-container ENTRYPOINT ["dbus-run-session", "--"] diff --git a/msal_extensions/__init__.py b/msal_extensions/__init__.py index adfb0e0..31b07c1 100644 --- a/msal_extensions/__init__.py +++ b/msal_extensions/__init__.py @@ -1,5 +1,5 @@ """Provides auxiliary functionality to the `msal` package.""" -__version__ = "1.0.0" +__version__ = "1.1.0" from .persistence import ( FilePersistence,