Skip to content

chore(release): v0.1.8 #3

chore(release): v0.1.8

chore(release): v0.1.8 #3

Workflow file for this run

name: Publish
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
id-token: write
concurrency:
group: publish-${{ github.ref_name }}
cancel-in-progress: false
jobs:
publish:
name: Publish packages to npm
runs-on: ubuntu-latest
steps:
- name: Checkout tag
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
cache: npm
- name: Update npm for OIDC publishing
run: |
npm install -g npm@latest
npm --version
- name: Install dependencies
run: npm ci
- name: Verify packages
run: npm run check
- name: Publish unpublished workspace packages
env:
NPM_CONFIG_PROVENANCE: "true"
run: |
set -euo pipefail
node - <<'NODE' > /tmp/pi-workspaces.tsv
const fs = require("node:fs");
const path = require("node:path");
const extensionsDir = "extensions";
for (const dirent of fs.readdirSync(extensionsDir, { withFileTypes: true })) {
if (!dirent.isDirectory()) continue;
const packageJsonPath = path.join(extensionsDir, dirent.name, "package.json");
if (!fs.existsSync(packageJsonPath)) continue;
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
if (packageJson.private) continue;
console.log(`${packageJson.name}\t${packageJson.version}`);
}
NODE
while IFS=$'\t' read -r package version; do
if [ -z "$package" ] || [ -z "$version" ]; then
continue
fi
if npm view "${package}@${version}" version >/dev/null 2>&1; then
echo "${package}@${version} already exists; skipping publish."
continue
fi
echo "Publishing ${package}@${version}..."
npm --workspace "$package" publish --access public --loglevel verbose
done < /tmp/pi-workspaces.tsv