Skip to content

Publish Packages #11381

Publish Packages

Publish Packages #11381

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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 'lts/*'
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
- name: Get pnpm cache info
id: pnpm-cache
shell: bash
run: echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
if: always()
with:
path: ./cache
key: pacote-cache-${{ github.run_id }}-${{ github.run_attempt }}
- run: pnpm store prune
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-${{ github.run_id }}-${{ github.run_attempt }}