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-08-28 08:18:28 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
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-08-28 08:18:28 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
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-09-18 08:04:08 +00:00
|
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.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-26 09:08:47 +00:00
|
|
|
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.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-07-03 07:46:25 +00:00
|
|
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
|
2022-10-06 09:44:52 +00:00
|
|
|
with:
|
|
|
|
context: ./docker
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|