forked from microsoft/DefinitelyTyped-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.67 KB
/
publish-packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 }}