Skip to content

Publish Packages #22317

Publish Packages

Publish Packages #22317

name: Publish Packages
on:
workflow_dispatch:
schedule:
- cron: '*/30 * * * *' # every 30 minutes
# publishing can take longer than 30 minutes but we never want to
# run more than one publish job at a time
concurrency: 1
env:
CI: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Get pnpm cache info
id: pnpm-cache
shell: bash
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ runner.os }}-pnpm-store-cache-
- run: pnpm install --frozen-lockfile
- run: pnpm build
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./cache
key: pacote-cache-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: pacote-cache-
- run: node packages/publisher/dist/run.js
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TYPES_TOKEN: ${{ secrets.NPM_TYPES_TOKEN }}
- uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
if: always()
with:
path: ./cache
key: pacote-cache-${{ github.run_id }}-${{ github.run_attempt }}
- run: pnpm store prune
- uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-${{ github.run_id }}-${{ github.run_attempt }}