Skip to content

Publish Packages

Publish Packages #8335

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