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-10-19 09:46:32 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
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
|
2023-11-10 13:45:37 +00:00
|
|
|
npm publish -w 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-10-19 09:46:32 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
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-12-05 09:31:18 +00:00
|
|
|
uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.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
|
2023-09-26 07:53:08 +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-11-21 14:30:05 +00:00
|
|
|
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.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 }}
|