From 44cd664ff79c55898ca47521629f8b6eb00471b6 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 29 Aug 2023 15:45:32 +0200 Subject: [PATCH 1/9] devops: Set up CI with Azure Pipelines --- .azure-pipelines/publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .azure-pipelines/publish.yml diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml new file mode 100644 index 000000000..29250a24a --- /dev/null +++ b/.azure-pipelines/publish.yml @@ -0,0 +1,21 @@ + +trigger: +- test + +pool: + vmImage: ubuntu-latest + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + displayName: 'Use Python' + +- script: | + python -m pip install --upgrade pip + pip install -r local-requirements.txt + pip install -e . + python setup.py bdist_wheel + python -m playwright install --with-deps + python setup.py bdist_wheel + displayName: 'Install dependencies' From fd60804df59c8efe4e49f6b87b2bc5c4488c7488 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 29 Aug 2023 17:11:44 +0200 Subject: [PATCH 2/9] Update publish.yml --- .azure-pipelines/publish.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index 29250a24a..c1cbb82fe 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -14,8 +14,12 @@ steps: - script: | python -m pip install --upgrade pip pip install -r local-requirements.txt - pip install -e . - python setup.py bdist_wheel - python -m playwright install --with-deps - python setup.py bdist_wheel displayName: 'Install dependencies' + +- script: | + pip install -e . + displayName: 'Install Playwright' + +- script: | + python setup.py bdist_wheel --all + displayName: 'Build' From b1c15cef7290932cc8b83d9beb0a80e5e2beac88 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Sep 2023 10:55:32 +0200 Subject: [PATCH 3/9] Update publish.yml for Azure Pipelines --- .azure-pipelines/publish.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index c1cbb82fe..f51260293 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -23,3 +23,17 @@ steps: - script: | python setup.py bdist_wheel --all displayName: 'Build' + +- task: EsrpRelease@4 + inputs: + ConnectedServiceName: 'Playwright-Java-ESRP' + Intent: 'PackageDistribution' + ContentType: 'PyPi' + ContentSource: 'Folder' + FolderLocation: './dist/' + WaitForReleaseCompletion: true + Owners: 'maxschmitt@microsoft.com' + Approvers: 'maxschmitt@microsoft.com' + ServiceEndpointUrl: 'https://api.esrp.microsoft.com' + MainPublisher: 'ESRPRELPACMAN' + DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' \ No newline at end of file From e7c673f7a0f375beb19679483be7ea47748fead3 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Sep 2023 11:03:31 +0200 Subject: [PATCH 4/9] version override --- setup.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup.py b/setup.py index c935ae536..d4e935c95 100644 --- a/setup.py +++ b/setup.py @@ -198,6 +198,7 @@ def _download_and_extract_local_driver( setup( + version="0.0.1", name="playwright", author="Microsoft Corporation", author_email="", @@ -230,11 +231,6 @@ def _download_and_extract_local_driver( ], python_requires=">=3.8", cmdclass={"bdist_wheel": PlaywrightBDistWheelCommand}, - use_scm_version={ - "version_scheme": "post-release", - "write_to": "playwright/_repo_version.py", - "write_to_template": 'version = "{version}"\n', - }, setup_requires=["setuptools-scm==7.0.5", "wheel==0.38.1"], entry_points={ "console_scripts": [ From 8ead844cc9792e7371c73f9e6b189a784016d535 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Sep 2023 11:03:52 +0200 Subject: [PATCH 5/9] Update publish.yml for Azure Pipelines --- .azure-pipelines/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index f51260293..21bb5ec9e 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -35,5 +35,5 @@ steps: Owners: 'maxschmitt@microsoft.com' Approvers: 'maxschmitt@microsoft.com' ServiceEndpointUrl: 'https://api.esrp.microsoft.com' - MainPublisher: 'ESRPRELPACMAN' + MainPublisher: 'Playwright' DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' \ No newline at end of file From 3d81b94608b4e47cd074ebef012d3f859076a2fa Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Sep 2023 11:17:52 +0200 Subject: [PATCH 6/9] Update publish.yml for Azure Pipelines --- .azure-pipelines/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index 21bb5ec9e..1f7998a43 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -26,7 +26,7 @@ steps: - task: EsrpRelease@4 inputs: - ConnectedServiceName: 'Playwright-Java-ESRP' + ConnectedServiceName: 'Playwright-ESRP' Intent: 'PackageDistribution' ContentType: 'PyPi' ContentSource: 'Folder' From c8e2fe72f230b237da504a48375ac6418e45b51d Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Sep 2023 11:21:25 +0200 Subject: [PATCH 7/9] Update publish.yml for Azure Pipelines --- .azure-pipelines/publish.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index 1f7998a43..c869b77da 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -1,6 +1,7 @@ - trigger: -- test + tags: + include: + - '*' pool: vmImage: ubuntu-latest @@ -36,4 +37,5 @@ steps: Approvers: 'maxschmitt@microsoft.com' ServiceEndpointUrl: 'https://api.esrp.microsoft.com' MainPublisher: 'Playwright' - DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' \ No newline at end of file + DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' + displayName: 'ESRP Release to PIP' From 8ebb57bae282c0407807c223a528a13455465e70 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 7 Sep 2023 11:22:18 +0200 Subject: [PATCH 8/9] stuff --- .github/workflows/publish.yml | 21 --------------------- setup.py | 6 +++++- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 191d8a387..5ef512838 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,27 +3,6 @@ on: release: types: [published] jobs: - deploy-pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r local-requirements.txt - pip install -e . - python setup.py bdist_wheel --all - python -m playwright install-deps - - name: Publish package - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: twine upload dist/* - deploy-conda: strategy: matrix: diff --git a/setup.py b/setup.py index d4e935c95..c935ae536 100644 --- a/setup.py +++ b/setup.py @@ -198,7 +198,6 @@ def _download_and_extract_local_driver( setup( - version="0.0.1", name="playwright", author="Microsoft Corporation", author_email="", @@ -231,6 +230,11 @@ def _download_and_extract_local_driver( ], python_requires=">=3.8", cmdclass={"bdist_wheel": PlaywrightBDistWheelCommand}, + use_scm_version={ + "version_scheme": "post-release", + "write_to": "playwright/_repo_version.py", + "write_to_template": 'version = "{version}"\n', + }, setup_requires=["setuptools-scm==7.0.5", "wheel==0.38.1"], entry_points={ "console_scripts": [ From f923b2891d8b548919375f24f6ac258247b948e1 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 19 Sep 2023 00:04:38 +0200 Subject: [PATCH 9/9] Update publish.yml --- .azure-pipelines/publish.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index c869b77da..8e209dacd 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -15,15 +15,9 @@ steps: - script: | python -m pip install --upgrade pip pip install -r local-requirements.txt - displayName: 'Install dependencies' - -- script: | pip install -e . - displayName: 'Install Playwright' - -- script: | python setup.py bdist_wheel --all - displayName: 'Build' + displayName: 'Install & Build' - task: EsrpRelease@4 inputs: