-
Notifications
You must be signed in to change notification settings - Fork 192
47 lines (38 loc) · 1.19 KB
/
publish-release.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
name: publish-release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
force-npm-publish:
description: "Force npm publish"
type: boolean
permissions:
contents: write
pull-requests: write
jobs:
publish-release:
if: github.repository == 'mdn/data'
runs-on: ubuntu-latest
steps:
- name: Release
uses: GoogleCloudPlatform/release-please-action@v4
id: release
- name: Setup
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
uses: actions/checkout@v4
- name: Checkout
if: ${{ github.event.inputs.force-npm-publish || steps.release.outputs.release_created }}
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org/"
node-version-file: ".nvmrc"
- 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
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}