-
Notifications
You must be signed in to change notification settings - Fork 509
73 lines (61 loc) · 2.29 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
70
71
72
73
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: googleapis/release-please-action@v4
id: release
- name: Checkout
uses: actions/checkout@v4
if: steps.release.outputs.release_created
- name: Setup
uses: actions/setup-node@v4
if: steps.release.outputs.release_created
with:
node-version-file: ".nvmrc"
cache: yarn
registry-url: "https://registry.npmjs.org"
- name: Cache @vscode/ripgrep bin
uses: actions/cache@v4
if: steps.release.outputs.release_created
with:
key: vscode-ripgrep-bin-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('yarn.lock') }}
path: node_modules/@vscode/ripgrep/bin/
- 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_WRITER_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 }}