Skip to content
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
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install dependencies
run: npm ci

- name: Lint with Biome
run: npx biome check .

typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install dependencies
run: npm ci

- name: Type check
run: npx tsc --build

build:
name: Build CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install dependencies
run: npm ci

- name: Build CLI
run: npm run build:cli

- name: Verify build output
run: test -f packages/cli/dist/index.js
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish to npm

on:
release:
types: [published]

jobs:
validate:
name: Validate release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install dependencies
run: npm ci

- name: Check tag matches package version
run: |
TAG="${GITHUB_REF#refs/tags/v}"
PKG_VERSION=$(node -p "require('./packages/cli/package.json').version")
echo "Git tag version: $TAG"
echo "Package version: $PKG_VERSION"
if [ "$TAG" != "$PKG_VERSION" ]; then
echo "::error::Tag v$TAG does not match packages/cli/package.json version ($PKG_VERSION)"
exit 1
fi

- name: Lint
run: npx biome check .

- name: Type check
run: npx tsc --build

- name: Build CLI
run: npm run build:cli

- name: Verify build output
run: test -f packages/cli/dist/index.js

publish:
name: Publish to npm
needs: validate
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build CLI
run: npm run build:cli

- name: Publish to npm
run: npm publish -w @plexusui/cli --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading