playwright/.github/workflows/publish_canary.yml
Andrey Lushnikov 32bc83d322
chore: be on the safe side with publishing release candidate (#10363)
Make sure we never publish any other version that contains `rc`
as part of the version.

References #10334
2021-11-16 15:38:14 -08:00

88 lines
3.3 KiB
YAML

name: "publish canary"
on:
workflow_dispatch:
schedule:
- cron: "10 0 * * *"
push:
branches:
- release-*
jobs:
publish-canary:
name: "publish canary NPM & Trigger canary Docker"
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
- name: "@next: publish with commit timestamp (triggered manually)"
if: contains(github.ref, 'master') && github.event_name == 'workflow_dispatch'
run: |
node utils/build/update_canary_version.js --alpha --commit-timestamp
utils/publish_all_packages.sh --alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: "@next: publish with today's date (triggered automatically)"
if: contains(github.ref, 'master') && github.event_name != 'workflow_dispatch'
run: |
node utils/build/update_canary_version.js --alpha --today-date
utils/publish_all_packages.sh --alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: "@beta: publish with commit timestamp (triggered automatically)"
if: contains(github.ref, 'release') && github.event_name != 'workflow_dispatch'
run: |
node utils/build/update_canary_version.js --beta --commit-timestamp
utils/publish_all_packages.sh --beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: build & publish driver
env:
AZ_UPLOAD_FOLDER: driver/next
AZ_ACCOUNT_KEY: ${{ secrets.AZ_ACCOUNT_KEY }}
AZ_ACCOUNT_NAME: ${{ secrets.AZ_ACCOUNT_NAME }}
run: |
utils/build/build-playwright-driver.sh
utils/build/upload-playwright-driver.sh
- name: trigger docker build
run: |
VERSION=$(node -e 'console.log(require("./package.json").version)')
if [[ "${VERSION}" != *-* ]]; then
echo "ERROR: canary version must have dash inside, received '${VERSION}' instead"
exit 1
fi
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}" \
--data "{\"event_type\": \"publish_docker\", \"client_payload\": {\"ref\": \"${{ github.sha }}\", \"package_version\": \"${VERSION}\", \"release_channel\": \"canary\"}}" \
https://api.github.com/repos/microsoft/playwright-internal/dispatches
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 Canary
run: bash utils/build/deploy-trace-viewer.sh --canary
if: contains(github.ref, 'master')
env:
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
- name: Deploy BETA
run: bash utils/build/deploy-trace-viewer.sh --beta
if: contains(github.ref, 'release')
env:
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}