Skip to content

platform: fix annotation-agnostic selection paths for base USJ #1219

platform: fix annotation-agnostic selection paths for base USJ

platform: fix annotation-agnostic selection paths for base USJ #1219

Workflow file for this run

name: Test
on:
push:
branches: ["main"]
tags: ["**"]
pull_request:
# The branches below should be a subset of the branches above
branches: ["main"]
workflow_dispatch:
inputs:
# Allow debugging a GHA build agent. This is the trigger. See the last step.
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
# env:
# Temporarily disabled while Nx Cloud credits are exhausted. IJH: 2026 Feb 16
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
# Needed for nx-set-shas when run on the main branch
permissions:
actions: read
contents: read
pull-requests: read
# Required for npm provenance
id-token: write
jobs:
test:
name: Build on ${{ matrix.os }}, node ${{ matrix.node_version }}, PNPM ${{ matrix.pnpm_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node_version: [20]
pnpm_version: [10]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install PNPM
uses: pnpm/action-setup@v3
with:
version: ${{ matrix.pnpm_version }}
- name: Install Node.js and npm
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: ${{ matrix.node_version }}
cache: pnpm
- name: Verify and upgrade npm (Trusted Publishing requires npm >= 11.5.1)
run: |
echo "npm before upgrade:"
npm --version
npm i -g npm@^11.5.1
echo "npm after upgrade:"
npm --version
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
- name: Check formatting
run: |
pnpm prettier --check .
pnpm nx format:check
- name: Check linting
run: pnpm nx affected -t lint
- name: Check types
run: pnpm nx affected -t typecheck
- name: Check tests
run: pnpm nx affected -t test
- name: Production build
run: pnpm nx affected -t build
# With help from https://stackoverflow.com/questions/75357158/github-actions-npm-publish-fails-with-err-code-eneedauth
- name: pnpm publish platform-editor
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/platform_v') && contains(github.ref, '.') }}
shell: bash
run: |
cd ./packages/platform
pnpm publish --no-git-checks
- name: pnpm publish scribe-editor
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/scribe_v') && contains(github.ref, '.') }}
shell: bash
run: |
cd ./packages/scribe
pnpm publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: npm publish scripture-utilities
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/utilities_v') && contains(github.ref, '.') }}
shell: bash
run: |
cd ./packages/utilities
pnpm publish --no-git-checks
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true