2021-11-02 13:01:49 +03:00
|
|
|
name: "publish canary"
|
2020-04-21 03:45:29 +03:00
|
|
|
|
|
|
|
on:
|
2021-06-04 00:50:40 +03:00
|
|
|
workflow_dispatch:
|
2021-02-10 01:28:04 +03:00
|
|
|
schedule:
|
|
|
|
- cron: "10 0 * * *"
|
2020-04-21 03:45:29 +03:00
|
|
|
push:
|
|
|
|
branches:
|
2020-04-22 05:20:19 +03:00
|
|
|
- release-*
|
2020-04-21 03:45:29 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-11-02 13:01:49 +03:00
|
|
|
publish-canary:
|
|
|
|
name: "publish canary NPM & Trigger canary Docker"
|
2021-04-05 22:39:15 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2020-08-01 00:09:36 +03:00
|
|
|
if: github.repository == 'microsoft/playwright'
|
2020-04-21 03:45:29 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-04-05 22:39:15 +03:00
|
|
|
- uses: actions/setup-node@v2
|
2020-04-21 03:45:29 +03:00
|
|
|
with:
|
2021-04-30 17:49:10 +03:00
|
|
|
node-version: 12
|
2020-04-21 03:45:29 +03:00
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2021-10-11 17:52:17 +03:00
|
|
|
- run: npm i -g npm@7
|
2020-04-21 03:45:29 +03:00
|
|
|
- run: npm ci
|
2020-07-02 01:22:29 +03:00
|
|
|
- run: npm run build
|
2021-10-11 17:52:17 +03:00
|
|
|
- run: npx playwright install-deps
|
2021-11-02 12:35:03 +03:00
|
|
|
- name: "@next: publish with commit timestamp (triggered manually)"
|
|
|
|
if: contains(github.ref, 'master') && github.event_name == 'workflow_dispatch'
|
|
|
|
run: |
|
2021-11-02 13:42:00 +03:00
|
|
|
node utils/build/update_canary_version.js --commit-timestamp
|
2021-11-02 12:35:03 +03:00
|
|
|
utils/publish_all_packages.sh --next
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: "@next: publish with today's date (triggered automatically)"
|
2021-06-04 00:50:40 +03:00
|
|
|
if: contains(github.ref, 'master') && github.event_name != 'workflow_dispatch'
|
2021-11-02 03:29:56 +03:00
|
|
|
run: |
|
|
|
|
node utils/build/update_canary_version.js --today-date
|
2021-11-02 12:35:03 +03:00
|
|
|
utils/publish_all_packages.sh --next
|
2021-11-02 03:29:56 +03:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2021-11-02 12:35:03 +03:00
|
|
|
- name: "@beta: publish with commit timestamp (triggered automatically)"
|
|
|
|
if: contains(github.ref, 'release') && github.event_name != 'workflow_dispatch'
|
2021-11-02 03:29:56 +03:00
|
|
|
run: |
|
|
|
|
node utils/build/update_canary_version.js --commit-timestamp
|
|
|
|
utils/publish_all_packages.sh --beta
|
2020-04-21 03:45:29 +03:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2021-11-02 13:01:49 +03:00
|
|
|
- run: |
|
|
|
|
# Trigger canary docker build and tag it with NPM canary version
|
|
|
|
VERSION=$(node -e 'console.log(require("./package.json").version)')
|
|
|
|
curl -X POST \
|
|
|
|
-H "Accept: application/vnd.github.v3+json" \
|
|
|
|
-H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_PERSONAL_ACCESS_TOKEN }}" \
|
|
|
|
--data "{\"event_type\": \"build_docker_canary\", \"client_payload\": {\"ref\": \"${{ github.sha }}\", \"package_version\": \"${VERSION}\"}}" \
|
|
|
|
https://api.github.com/repos/microsoft/playwright-internal/dispatches
|
2020-04-21 03:45:29 +03:00
|
|
|
|