90 lines
2.1 KiB
YAML
90 lines
2.1 KiB
YAML
name: "@luzzle/core"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- '@luzzle/core@*'
|
|
paths:
|
|
- 'apps/core/**'
|
|
- '.github/workflows/core.yml'
|
|
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'apps/core/**'
|
|
- '.github/workflows/core.yml'
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '26'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: pnpm --filter @luzzle/core lint
|
|
|
|
- name: Build
|
|
run: pnpm --filter @luzzle/core build
|
|
|
|
- name: Test
|
|
run: pnpm --filter @luzzle/core test
|
|
|
|
publish:
|
|
needs: check
|
|
if: github.ref_type == 'tag' && startsWith(github.ref_name, '@luzzle/core@')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '26'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: pnpm --filter @luzzle/core build
|
|
|
|
- name: Check Version
|
|
run: |
|
|
VERSION_FROM_PKG=$(node -p "require('./apps/core/package.json').version")
|
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
|
VERSION_FROM_TAG=${TAG_NAME#@luzzle/core@}
|
|
|
|
if [ "$VERSION_FROM_TAG" != "$VERSION_FROM_PKG" ]; then
|
|
echo "Version mismatch: Tag version $VERSION_FROM_TAG does not match package.json version $VERSION_FROM_PKG"
|
|
exit 1
|
|
fi
|
|
echo "Version $VERSION_FROM_PKG matches."
|
|
|
|
- name: Publish
|
|
run: pnpm --filter @luzzle/core publish --no-git-checks --access public
|