Merge remote-tracking branch 'upstream/main' #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |