From 62095b000b9ae4d4afb4ccff9f796aeb66b3e851 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 10 Jan 2022 15:05:48 -0700 Subject: [PATCH] devops: split release workflow into many (#11310) This way we can restart independent parts of the release independently. References #11292 --- .github/workflows/publish_release.yml | 90 ------------------- .github/workflows/publish_release_docker.yml | 32 +++++++ .github/workflows/publish_release_driver.yml | 27 ++++++ .github/workflows/publish_release_npm.yml | 29 ++++++ .../workflows/publish_release_traceviewer.yml | 21 +++++ 5 files changed, 109 insertions(+), 90 deletions(-) delete mode 100644 .github/workflows/publish_release.yml create mode 100644 .github/workflows/publish_release_docker.yml create mode 100644 .github/workflows/publish_release_driver.yml create mode 100644 .github/workflows/publish_release_npm.yml create mode 100644 .github/workflows/publish_release_traceviewer.yml diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml deleted file mode 100644 index d312551a9a..0000000000 --- a/.github/workflows/publish_release.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: "publish release" - -on: - release: - types: [published] - -jobs: - publish-npm-release: - name: "publish to NPM" - runs-on: ubuntu-20.04 - if: github.repository == 'microsoft/playwright' - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 12 - registry-url: 'https://registry.npmjs.org' - - run: npm i -g npm@8 - - run: npm ci - - run: npm run build - - run: npx playwright install-deps - - run: utils/publish_all_packages.sh --release-candidate - if: "github.event.release.prerelease" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: utils/publish_all_packages.sh --release - if: "!github.event.release.prerelease" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - publish-driver-release: - name: "publish playwright driver to CDN" - runs-on: ubuntu-20.04 - if: github.repository == 'microsoft/playwright' - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 12 - registry-url: 'https://registry.npmjs.org' - - run: npm i -g npm@8 - - run: npm ci - - run: npm run build - - run: npx playwright install-deps - - run: utils/build/build-playwright-driver.sh - - run: utils/build/upload-playwright-driver.sh - env: - AZ_UPLOAD_FOLDER: driver - AZ_ACCOUNT_KEY: ${{ secrets.AZ_ACCOUNT_KEY }} - AZ_ACCOUNT_NAME: ${{ secrets.AZ_ACCOUNT_NAME }} - - publish-docker-release: - name: "publish to DockerHub" - runs-on: ubuntu-20.04 - if: github.repository == 'microsoft/playwright' - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 12 - registry-url: 'https://registry.npmjs.org' - - uses: azure/docker-login@v1 - with: - login-server: playwright.azurecr.io - username: playwright - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up Docker QEMU for arm64 docker builds - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - run: npm i -g npm@8 - - run: npm ci - - run: npm run build - - run: npx playwright install-deps - - run: ./utils/docker/publish_docker.sh stable - - publish-trace-viewer: - name: "publish Trace Viewer to trace.playwright.dev" - runs-on: ubuntu-20.04 - if: github.repository == 'microsoft/playwright' - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16 - - run: npm i -g npm@7 - - name: Deploy Stable - run: bash utils/build/deploy-trace-viewer.sh --stable - env: - GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} diff --git a/.github/workflows/publish_release_docker.yml b/.github/workflows/publish_release_docker.yml new file mode 100644 index 0000000000..3f31bef3c8 --- /dev/null +++ b/.github/workflows/publish_release_docker.yml @@ -0,0 +1,32 @@ +name: "publish release - Docker" + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + publish-docker-release: + name: "publish to DockerHub" + runs-on: ubuntu-20.04 + if: github.repository == 'microsoft/playwright' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + - uses: azure/docker-login@v1 + with: + login-server: playwright.azurecr.io + username: playwright + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker QEMU for arm64 docker builds + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + - run: npm i -g npm@8 + - run: npm ci + - run: npm run build + - run: npx playwright install-deps + - run: ./utils/docker/publish_docker.sh stable diff --git a/.github/workflows/publish_release_driver.yml b/.github/workflows/publish_release_driver.yml new file mode 100644 index 0000000000..644f1e54e1 --- /dev/null +++ b/.github/workflows/publish_release_driver.yml @@ -0,0 +1,27 @@ +name: "publish release - driver" + +on: + release: + types: [published] + +jobs: + publish-driver-release: + name: "publish playwright driver to CDN" + runs-on: ubuntu-20.04 + if: github.repository == 'microsoft/playwright' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + - run: npm i -g npm@8 + - run: npm ci + - run: npm run build + - run: npx playwright install-deps + - run: utils/build/build-playwright-driver.sh + - run: utils/build/upload-playwright-driver.sh + env: + AZ_UPLOAD_FOLDER: driver + AZ_ACCOUNT_KEY: ${{ secrets.AZ_ACCOUNT_KEY }} + AZ_ACCOUNT_NAME: ${{ secrets.AZ_ACCOUNT_NAME }} diff --git a/.github/workflows/publish_release_npm.yml b/.github/workflows/publish_release_npm.yml new file mode 100644 index 0000000000..501d224af7 --- /dev/null +++ b/.github/workflows/publish_release_npm.yml @@ -0,0 +1,29 @@ +name: "publish release - NPM" + +on: + release: + types: [published] + +jobs: + publish-npm-release: + name: "publish to NPM" + runs-on: ubuntu-20.04 + if: github.repository == 'microsoft/playwright' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + - run: npm i -g npm@8 + - run: npm ci + - run: npm run build + - run: npx playwright install-deps + - run: utils/publish_all_packages.sh --release-candidate + if: "github.event.release.prerelease" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: utils/publish_all_packages.sh --release + if: "!github.event.release.prerelease" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish_release_traceviewer.yml b/.github/workflows/publish_release_traceviewer.yml new file mode 100644 index 0000000000..6ca16640ec --- /dev/null +++ b/.github/workflows/publish_release_traceviewer.yml @@ -0,0 +1,21 @@ +name: "publish release - TraceViewer" + +on: + release: + types: [published] + +jobs: + publish-trace-viewer: + name: "publish Trace Viewer to trace.playwright.dev" + runs-on: ubuntu-20.04 + if: github.repository == 'microsoft/playwright' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm i -g npm@7 + - name: Deploy Stable + run: bash utils/build/deploy-trace-viewer.sh --stable + env: + GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}