-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 2.09 KB
/
npm-publish.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
59
60
61
62
63
64
65
66
67
68
69
name: NPM Publish
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
build:
if: github.repository == 'mdn/yari'
runs-on: ubuntu-latest
steps:
- name: Release
uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: release-please-action
- name: Checkout
uses: actions/checkout@v3
if: steps.release.outputs.release_created
- name: Setup
uses: actions/setup-node@v3
if: steps.release.outputs.release_created
with:
node-version: 18
cache: yarn
registry-url: "https://registry.npmjs.org"
- name: Install
if: steps.release.outputs.release_created
run: yarn --frozen-lockfile
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
if: steps.release.outputs.release_created
env:
# What this does is it makes sure the built client is made for
# doing CRUD work (e.g. previewing, toolbar, flaws UI, etc)
REACT_APP_CRUD_MODE: true
# This makes sure the auth is disabled. I.e. the "Sign in" link
# in the header. It also disables any XHR checks to the server's
# whoami endpoint.
REACT_APP_DISABLE_AUTH: true
# The 'yarn build:prepare' command is going to try to build up a
# file for the git history so it can have an index of each files.
# This makes sense in most of the cases where you have a CONTENT_ROOT
# which you'll want to build. But the CONTENT_ROOT can't be empty
# so you have to set it to something. So let's (ab)use the content
# we use for the end-to-end testing.
CONTENT_ROOT: testing/content/files
run: yarn build:prepare
- name: Publish
if: steps.release.outputs.release_created
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}