-
Notifications
You must be signed in to change notification settings - Fork 212
49 lines (40 loc) · 1.43 KB
/
publish-release.yml
File metadata and controls
49 lines (40 loc) · 1.43 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
name: publish-release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
force-npm-publish:
description: "Force npm publish"
type: boolean
permissions:
contents: write
id-token: write # OIDC for npm Trusted Publishing
pull-requests: write
jobs:
publish-release:
if: github.repository == 'mdn/data'
runs-on: ubuntu-latest
steps:
- name: Release
uses: GoogleCloudPlatform/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release
- name: Checkout
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
registry-url: "https://registry.npmjs.org/"
node-version-file: ".nvmrc"
package-manager-cache: false
- name: Install
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
run: npm ci
- name: Publish
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
run: npm publish --access public --provenance