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
|
2024-03-18 10:04:38 +00:00
|
|
|
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.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
|
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
|
2024-03-18 10:04:38 +00:00
|
|
|
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.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
|
2024-03-18 10:04:38 +00:00
|
|
|
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.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
|
2024-02-05 10:45:49 +00:00
|
|
|
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
|
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
|
2024-03-18 10:04:38 +00:00
|
|
|
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
|
2022-10-06 09:44:52 +00:00
|
|
|
with:
|
|
|
|
context: ./docker
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|