mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
53 lines
1.9 KiB
YAML
53 lines
1.9 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
jobs:
|
|
publish:
|
|
name: Publish
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
pull-requests: write
|
|
contents: write
|
|
env:
|
|
# The repo is managed by Bun, but publishing uses npm for provenance.
|
|
# Keep Corepack from rejecting packageManager: bun@... when npm runs.
|
|
COREPACK_ENABLE_PROJECT_SPEC: 0
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
|
fetch-depth: 0
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- name: Update npm
|
|
run: |
|
|
corepack enable npm
|
|
corepack install -g npm@latest
|
|
- name: Setup Bun
|
|
uses: ./.github/composite/setup-bun
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: 1
|
|
- name: Create Release Pull Request
|
|
id: changesets
|
|
uses: changesets/action@v1
|
|
with:
|
|
publish: bun run publish-all-packages
|
|
version: bun run changeset-version
|
|
env:
|
|
# Using a PAT instead of GITHUB_TOKEN because we need to run workflows when releases are created
|
|
# https://github.com/orgs/community/discussions/26875#discussioncomment-3253761
|
|
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
|