forked from ddbeck/mdn-content-inventory
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (49 loc) · 1.49 KB
/
publish.yml
File metadata and controls
61 lines (49 loc) · 1.49 KB
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
59
60
61
name: Publish daily
on:
schedule:
- cron: "58 5 * * *"
workflow_dispatch:
inputs:
ref:
description: mdn/content commit to publish a release from
required: false
type: string
dryRun:
description: Don't actually publish to npm
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
id-token: write # trusted publishing + attestations
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: ".tool-versions"
check-latest: true
registry-url: "https://registry.npmjs.org"
- run: npm install -g 'npm@>=11.5.1' # required for trusted publishing
- run: npm ci
- run: |
if [ -n "$REF" ]; then
npm run build -- --verbose --ref="$REF"
else
npm run build -- --verbose
fi
env:
GH_TOKEN: ${{ github.token }}
REF: ${{ inputs.ref }}
- if: ${{ inputs.dryRun }}
run: npm run publish:dry-run
- if: ${{ ! inputs.dryRun }}
run: npm run publish
- run: npm info @mdn/content-inventory