86 lines
2.7 KiB
YAML
86 lines
2.7 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
release-pr:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Remove `-post` suffix
|
|
run: node utils/remove_version_suffix.js
|
|
- name: Release
|
|
uses: google-github-actions/release-please-action@v3
|
|
id: release
|
|
with:
|
|
release-type: node
|
|
package-name: puppeteer
|
|
command: github-release
|
|
|
|
publish:
|
|
needs: release-pr
|
|
if: ${{ needs.release-pr.outputs.release_created }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Install dependencies
|
|
run: npm install
|
|
- name: Build puppeteer
|
|
run: npm run build
|
|
- name: Publish puppeteer
|
|
env:
|
|
NPM_TOKEN: ${{secrets.NPM_TOKEN_PUPPETEER}}
|
|
run: |
|
|
npm config set registry 'https://wombat-dressing-room.appspot.com/'
|
|
npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NPM_TOKEN}'
|
|
echo "Publishing puppeteer"
|
|
npm publish
|
|
# DEPRECATED_RANGE=$(node utils/get_deprecated_version_range.js)
|
|
# echo "Deprecating old puppeteer versions: $DEPRECATED_RANGE"
|
|
# npm deprecate puppeteer@$DEPRECATED_RANGE "Version no longer supported. Upgrade to @latest"
|
|
- name: Publish puppeteer-core
|
|
env:
|
|
NPM_TOKEN: ${{secrets.NPM_TOKEN_PUPPETEER_CORE}}
|
|
run: |
|
|
utils/prepare_puppeteer_core.js
|
|
npm config set registry 'https://wombat-dressing-room.appspot.com/'
|
|
npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NPM_TOKEN}'
|
|
npm publish
|
|
|
|
post-publish:
|
|
needs: publish
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Append `-post` to version
|
|
id: post-version
|
|
run: |
|
|
npm version --no-git-tag-version --no-commit-hooks "$(jq -r .version ./package.json)-post"
|
|
echo ::set-output name=VERSION::$(jq -r .version ./package.json)
|
|
- name: Build
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
npm run doc
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.name 'actions-bot'
|
|
git config --global user.email '<github-actions-bot@google.com>'
|
|
- name: Commit and push
|
|
run: |
|
|
git add -A
|
|
git commit -m "chore: bump version to ${{ steps.post-version.outputs.VERSION }}"
|
|
git push
|