Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 32 additions & 61 deletions .github/workflows/node.js-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,42 @@ on:
- main
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_ACCESS_TOKEN: '${{ secrets.NX_CLOUD_ACCESS_TOKEN }}'

jobs:
main:
build-and-deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v6
name: Checkout [main]
with:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: "24"
- uses: pnpm/action-setup@v6
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm version
id: pnpm-version
run: |
echo "$(pnpm --version)"

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Derive SHAs for nx affected
uses: nrwl/nx-set-shas@v5

- uses: actions/cache@v5
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Clean tmp-files directory
run: rm -rf tests/tmp-files
if: always()
- run: pnpm install
- run: pnpm run build:ci
- run: pnpm test
- name: Stop Nx Cloud Session
run: pnpm nx fix-ci
if: always()
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: "24"
- uses: pnpm/action-setup@v6
name: Install pnpm
id: pnpm-install
node-version: '24'

- uses: pnpm/action-setup@v6.0.3
with:
run_install: false
- name: Get pnpm version
id: pnpm-version
run: |
echo "$(pnpm --version)"

- name: Initialize Nx Cloud
run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js"

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v5
name: Setup pnpm cache
Expand All @@ -86,12 +53,16 @@ jobs:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Clean tmp-files directory
run: rm -rf tests/tmp-files
if: always()
- run: pnpm install
- run: pnpm run build:ci
- run: pnpm test

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm run build:ci

- name: Run tests
run: pnpm test

- name: Stop Nx Cloud Session
run: pnpm nx fix-ci
if: always()
run: npx nx fix-ci
if: always()
19 changes: 14 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ permissions:
id-token: write
contents: read

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_ACCESS_TOKEN: '${{ secrets.NX_CLOUD_ACCESS_TOKEN }}'

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -30,6 +34,9 @@ jobs:
with:
run_install: false

- name: Initialize Nx Cloud
run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js"

- name: Get pnpm store directory
id: pnpm-cache
run: |
Expand All @@ -54,17 +61,19 @@ jobs:
- name: Publish to NPM (OIDC Auth)
run: |
TAG="${GITHUB_REF#refs/tags/}"

BASE_CMD="npx pnpm publish --ignore-scripts --no-git-checks"
BASE_CMD="pnpm exec nx release publish --skip-version"

if [[ "$TAG" == *"-alpha."* ]]; then
$BASE_CMD --pre-dist-tag alpha
$BASE_CMD --tag=alpha
elif [[ "$TAG" == *"-beta."* ]]; then
$BASE_CMD --pre-dist-tag beta
$BASE_CMD --tag=beta
else
$BASE_CMD
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NX_CLOUD_DISTRIBUTED_EXECUTION: false

- name: Stop Nx Cloud Session
run: pnpm nx fix-ci
run: npx nx fix-ci
if: always()