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
39 changes: 38 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
release:
types: [published]
jobs:
deploy:
deploy-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -28,3 +28,40 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
publish-docker:
name: "publish to DockerHub"
runs-on: ubuntu-20.04
if: github.repository == 'microsoft/playwright-python'
steps:
- uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: playwright.azurecr.io
username: playwright
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: microsoft/playwright-github-action@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
- name: Build package
run: python build_package.py
- name: Install
run: python -m playwright install
- name: Build Docker image
run: docker build -t playwright-python:localbuild .
- name: tag & publish
run: |
# GITHUB_REF has a form of `refs/tags/v1.3.0`.
# TAG_NAME would be `v1.3.0`
TAG_NAME=${GITHUB_REF#refs/tags/}
./scripts/tag_image_and_push.sh playwright-python:localbuild playwright.azurecr.io/public/playwright-python:latest
./scripts/tag_image_and_push.sh playwright-python:localbuild playwright.azurecr.io/public/playwright-python:${TAG_NAME}

./scripts/tag_image_and_push.sh playwright-python:localbuild playwright.azurecr.io/public/playwright-python:focal
./scripts/tag_image_and_push.sh playwright:localbuild-focal playwright.azurecr.io/public/playwright-python:${TAG_NAME}-focal
42 changes: 42 additions & 0 deletions .github/workflows/publish_canary_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "devrelease:docker"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why do we need this one?

Copy link
Copy Markdown
Contributor Author

@mxschmitt mxschmitt Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also remove the canary builds. They were useful for testing and Lushnikov and me used them a lot so I think it brings value.


on:
push:
branches:
- master
- release-*
paths:
- .github/workflows/publish_canary_docker.yml

jobs:
publish-canary-docker:
name: "publish to DockerHub"
runs-on: ubuntu-20.04
if: github.repository == 'microsoft/playwright-python'
steps:
- uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: playwright.azurecr.io
username: playwright
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: microsoft/playwright-github-action@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
- name: Build package
run: python build_package.py
- name: Install
run: python -m playwright install
- run: docker build -t playwright-python:localbuild .
- name: tag & publish
run: |
./scripts/tag_image_and_push.sh playwright-python:localbuild playwright.azurecr.io/public/playwright-python:next
./scripts/tag_image_and_push.sh playwright-python:localbuild playwright.azurecr.io/public/playwright-python:next-focal
./scripts/tag_image_and_push.sh playwright-python:localbuild playwright.azurecr.io/public/playwright-python:sha-${{ github.sha }}
12 changes: 5 additions & 7 deletions .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on:
push:
paths:
- '.github/workflows/test_docker.yml'
- 'driver/**'
- 'build_package.py'
branches:
- master
pull_request:
paths:
- '.github/workflows/test_docker.yml'
- 'driver/**'
- 'build_package.py'
branches:
- master
jobs:
Expand All @@ -18,10 +18,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -42,4 +38,6 @@ jobs:
CONTAINER_ID="$(docker run --rm -v $(pwd):/root/playwright --name playwright-docker-test -d -t playwright-python:localbuild /bin/bash)"
docker exec --workdir /root/playwright/ "${CONTAINER_ID}" pip install -r local-requirements.txt
docker exec --workdir /root/playwright/ "${CONTAINER_ID}" pip install -e .
docker exec --workdir /root/playwright/ "${CONTAINER_ID}" xvfb-run pytest -vv
docker exec --workdir /root/playwright/ "${CONTAINER_ID}" python build_package.py
docker exec --workdir /root/playwright/ "${CONTAINER_ID}" xvfb-run pytest -vv tests/sync/
docker exec --workdir /root/playwright/ "${CONTAINER_ID}" xvfb-run pytest -vv tests/async/
5 changes: 5 additions & 0 deletions scripts/tag_image_and_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "-- tagging: $2"
docker tag $1 $2
docker push $2