2022-05-30 09:47:15 +00:00
|
|
|
name: Publish
|
2022-05-18 16:06:58 +00:00
|
|
|
|
2023-02-23 15:37:36 +00:00
|
|
|
permissions: read-all
|
|
|
|
|
2022-05-19 16:14:47 +00:00
|
|
|
on:
|
2022-08-03 04:26:56 +00:00
|
|
|
workflow_dispatch:
|
2022-05-19 16:14:47 +00:00
|
|
|
push:
|
2022-05-30 09:47:15 +00:00
|
|
|
tags:
|
2022-10-06 09:44:52 +00:00
|
|
|
- '*v*'
|
2022-05-18 16:06:58 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-10-06 09:44:52 +00:00
|
|
|
npm-publish:
|
|
|
|
name: Publish npm packages
|
2022-05-19 16:14:47 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
steps:
|
2022-10-06 10:44:45 +00:00
|
|
|
- name: Check out repository
|
2023-06-02 09:52:21 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-05-19 16:14:47 +00:00
|
|
|
- name: Install dependencies
|
2023-03-10 07:52:48 +00:00
|
|
|
run: npm ci
|
|
|
|
env:
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
2022-10-05 12:17:03 +00:00
|
|
|
- name: Build packages
|
2022-05-19 16:14:47 +00:00
|
|
|
run: npm run build
|
2022-10-06 09:44:52 +00:00
|
|
|
- name: Set npm registry
|
|
|
|
run: npm config set registry 'https://wombat-dressing-room.appspot.com/'
|
2022-10-05 12:17:03 +00:00
|
|
|
- name: Publish packages
|
2022-05-19 16:14:47 +00:00
|
|
|
env:
|
2022-10-05 12:17:03 +00:00
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN_RELEASE}}
|
2022-05-19 16:14:47 +00:00
|
|
|
run: |
|
2022-10-05 12:17:03 +00:00
|
|
|
npm config set '//wombat-dressing-room.appspot.com/:_authToken' $NODE_AUTH_TOKEN
|
2022-10-06 09:44:52 +00:00
|
|
|
npm publish --workspace packages/${GITHUB_REF_NAME%-v*}
|
2022-11-23 13:53:18 +00:00
|
|
|
- name: Deprecate old Puppeteer versions
|
2022-11-23 11:48:14 +00:00
|
|
|
if: ${{ startsWith(github.ref_name, 'puppeteer-v') }}
|
2022-11-23 13:53:18 +00:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN_PUPPETEER}}
|
2022-11-15 11:54:25 +00:00
|
|
|
run: |
|
2022-11-23 13:53:18 +00:00
|
|
|
npm config set '//wombat-dressing-room.appspot.com/:_authToken' $NODE_AUTH_TOKEN
|
2022-11-15 11:54:25 +00:00
|
|
|
version_range=$(node tools/get_deprecated_version_range.js)
|
2022-12-16 13:49:18 +00:00
|
|
|
npm deprecate puppeteer@"$version_range" "$version_range is no longer supported" || true
|
2022-10-06 09:44:52 +00:00
|
|
|
docker-publish:
|
|
|
|
name: Publish Docker image
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-23 11:48:14 +00:00
|
|
|
if: ${{ startsWith(github.ref_name, 'puppeteer-v') }}
|
2022-10-06 09:44:52 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
steps:
|
2022-10-06 10:44:45 +00:00
|
|
|
- name: Check out repository
|
2023-06-02 09:52:21 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-06 09:44:52 +00:00
|
|
|
- name: Install dependencies
|
2023-03-10 07:52:48 +00:00
|
|
|
run: npm ci
|
|
|
|
env:
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
2022-10-06 09:44:52 +00:00
|
|
|
- name: Build packages
|
|
|
|
run: npm run build
|
|
|
|
- name: Pack packages for docker
|
|
|
|
run: docker/pack.sh
|
|
|
|
# Based on https://docs.github.com/en/actions/publishing-packages/publishing-docker-images.
|
|
|
|
- name: Log in to the Container registry
|
2023-06-19 07:45:01 +00:00
|
|
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
|
2022-10-06 09:44:52 +00:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2023-06-02 09:52:21 +00:00
|
|
|
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0
|
2022-10-06 09:44:52 +00:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
tags: |
|
|
|
|
latest
|
2022-11-23 11:48:14 +00:00
|
|
|
type=match,pattern=puppeteer-v(\d+\.\d+\.\d+),group=1
|
2022-10-06 09:44:52 +00:00
|
|
|
- name: Build and push the Docker image
|
2023-06-13 06:22:45 +00:00
|
|
|
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf # v4.1.0
|
2022-10-06 09:44:52 +00:00
|
|
|
with:
|
|
|
|
context: ./docker
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|