Skip to content
Closed
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
42 changes: 11 additions & 31 deletions .github/workflows/policy-lerna-publish.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,75 @@
name: reusable publish (lerna)

on:
workflow_call:
inputs:
npm:
description: 'Publish lerna monorepo to NPM'
description: Publish lerna monorepo to NPM
type: boolean
default: false
gh:
description: 'Publish lerna monorepo to GitHub Packages'
description: Publish lerna monorepo to GitHub Packages
type: boolean
default: true
secrets:
npm_token:
required: false

env:
NODE_VERSION: 22

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NODE_VERSION: 22
NODE_VERSION: 24

NPM_SCOPE: '@stoe'

NPM_SCOPE: "@stoe"
jobs:
publish_npm:
if: ${{ inputs.npm }}

runs-on: ubuntu-latest

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

permissions:
contents: read
packages: write

env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0

with:
node-version: ${{ env.NODE_VERSION }}
node-version: 24

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
node-version: 24
node-version: ${{ env.NODE_VERSION }}

scope: ${{ env.NPM_SCOPE }}
registry-url: 'https://registry.npmjs.org'

registry-url: https://registry.npmjs.org
- name: NPM config
run: |
npm pkg delete scripts.prepare
npm install --ignore-scripts --pure-lockfile
git ls-files -z . | xargs -0 git update-index --assume-unchanged

- name: GitHub Packages publish
run: npx lerna publish from-package --yes --registry https://registry.npmjs.org

publish_gh:
if: ${{ inputs.gh }}

runs-on: ubuntu-latest

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

permissions:
contents: read
packages: write

env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0

with:
node-version: ${{ env.NODE_VERSION }}
node-version: 24

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
node-version: 24
node-version: ${{ env.NODE_VERSION }}

scope: ${{ env.NPM_SCOPE }}
registry-url: 'https://npm.pkg.github.com'

registry-url: https://npm.pkg.github.com
- name: NPM config
run: |
npm pkg delete scripts.prepare
npm install --ignore-scripts --pure-lockfile
git ls-files -z . | xargs -0 git update-index --assume-unchanged

- name: GitHub Packages publish
run: npx lerna publish from-package --yes --registry https://npm.pkg.github.com
54 changes: 19 additions & 35 deletions .github/workflows/policy-lerna-test.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,87 @@
name: reusable test (lerna)

on:
workflow_call:

workflow_call: null
jobs:
test-matrix:
runs-on: ubuntu-latest

permissions:
contents: read
packages: read

env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
fail-fast: true
matrix:
node-version:
- 20
- 22
experimental: [false]
- 24

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 24

- 24
experimental:
- false
include:
- node-version: 24
experimental: true
- node-version: lts/*
experimental: true

continue-on-error: ${{ matrix.experimental }}

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

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

with:
lfs: true

- name: Check repository visibility
if: ${{ github.event_name == 'pull_request' }}
id: visibility
run: |
echo "isPrivate=$(gh repo view --json isPrivate --jq '.isPrivate')" >> $GITHUB_OUTPUT
run: >
echo "isPrivate=$(gh repo view --json isPrivate --jq '.isPrivate')" >>
$GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check repository dependency graph
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
if: ${{ github.event_name == 'pull_request' && steps.visibility.outputs.isPrivate == 'false' }}

uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0

if: ${{ github.event_name == 'pull_request' &&
steps.visibility.outputs.isPrivate == 'false' }}
- name: Setup Node.js v${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0

with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'

node-version: 24

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
node-version: 24
node-version: ${{ matrix.node-version }}

registry-url: https://npm.pkg.github.com
cache: npm
- name: Get NPM cache directory
id: npm-cache-dir
run: |
echo "NPM_CACHE_DIR=$(npm config get cache)" >> "$GITHUB_OUTPUT"

- name: Cache node modules
id: cache-npm
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0

env:
cache-name: cache-node-modules
with:
path: ${{ steps.npm-cache-dir.outputs.NPM_CACHE_DIR }}
key: npm-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
key: npm-${{ runner.os }}-${{ env.cache-name }}-${{
hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ runner.os }}-${{ env.cache-name }}-
npm-${{ runner.os }}-
npm-

- name: NPM config
run: |
npm pkg delete scripts.prepare
npm install --ignore-scripts --pure-lockfile

- name: List the state of node modules
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
continue-on-error: true
run: npm list --omit=dev

- name: Build
run: npm run build --if-present

- name: Test
run: npx lerna run test

test:
runs-on: ubuntu-latest

needs: test-matrix

steps:
- name: Success
run: echo "success"
42 changes: 11 additions & 31 deletions .github/workflows/policy-node-publish.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,72 @@
name: reusable publish (package)

on:
workflow_call:
inputs:
npm:
description: 'Publish to NPM'
description: Publish to NPM
type: boolean
default: false
gh:
description: 'Publish to GitHub Packages'
description: Publish to GitHub Packages
type: boolean
default: true

env:
NODE_VERSION: 24
NPM_SCOPE: '@stoe'

NPM_SCOPE: "@stoe"
jobs:
publish_npm:
if: ${{ inputs.npm }}

runs-on: ubuntu-latest

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

permissions:
contents: read
id-token: write

env:
CI: true

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0

with:
node-version: ${{ env.NODE_VERSION }}
node-version: 24

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
node-version: 24
node-version: ${{ env.NODE_VERSION }}

scope: ${{ env.NPM_SCOPE }}
registry-url: 'https://registry.npmjs.org'

registry-url: https://registry.npmjs.org
- name: NPM config
run: |
npm pkg delete scripts.prepare
npm install --ignore-scripts --pure-lockfile
git ls-files -z . | xargs -0 git update-index --assume-unchanged

- name: NPM publish
run: NODE_AUTH_TOKEN="" npm publish --access public --provenance

publish_gh:
if: ${{ inputs.gh }}

runs-on: ubuntu-latest

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

permissions:
contents: read
packages: write
id-token: write

env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0

with:
node-version: ${{ env.NODE_VERSION }}
node-version: 24
scope: ${{ env.NPM_SCOPE }}
registry-url: 'https://npm.pkg.github.com'

registry-url: https://npm.pkg.github.com
- name: NPM config
run: |
npm pkg delete scripts.prepare
npm install --ignore-scripts --pure-lockfile
git ls-files -z . | xargs -0 git update-index --assume-unchanged

- name: GitHub Packages publish
run: npm publish --access public
Loading