chore(ci): migrate workflows from GitHub to Gitea; update lockfile

This commit is contained in:
2026-06-15 16:55:23 +07:00
parent 8adc2522c6
commit 4c8c3a396e
3 changed files with 94 additions and 91 deletions
-102
View File
@@ -1,102 +0,0 @@
name: CI
on:
pull_request:
branches:
- master
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 24.x
jobs:
# Enumerate the workspace packages so the matrix below fans out one job per
# package (kept dynamic so new packages are picked up automatically).
discover:
name: Discover packages
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.list.outputs.packages }}
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
run_install: false
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: List workspace packages
id: list
run: echo "packages=$(pnpm -r ls --depth -1 --json | jq -c '[.[] | select(.name != "tools") | .name]')" >> "$GITHUB_OUTPUT"
# One job per package — build (with its workspace deps), lint and test run in
# parallel across packages. fail-fast: false so every package is reported.
check:
name: ${{ matrix.package }}
needs: discover
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.discover.outputs.packages) }}
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
run_install: false
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Build the package and the workspace deps it relies on (incl. @robonen/eslint,
# which every package's lint config imports from its built dist).
- name: Build
run: pnpm --filter "${{ matrix.package }}..." --if-present run build
# Only the browser-mode test suites (vitest `instances: chromium`) need a
# browser. playwright is a direct devDep of these packages, so run its CLI
# in the package context (--filter) — it isn't resolvable from the root.
- name: Install Playwright Chromium
if: matrix.package == '@robonen/primitives' || matrix.package == '@robonen/editor'
run: pnpm --filter "${{ matrix.package }}" exec playwright install --with-deps chromium
- name: Lint
run: pnpm --filter "${{ matrix.package }}" --if-present run lint:check
- name: Test
run: pnpm --filter "${{ matrix.package }}" --if-present run test
# Sentinel job — aggregates all matrix results into a single status check.
# Add "CI" as the required check in branch protection rules.
ci:
name: CI
needs: check
if: always()
runs-on: ubuntu-latest
steps:
- name: All checks passed
run: |
if [[ "${{ needs.check.result }}" != "success" ]]; then
echo "One or more package checks failed: ${{ needs.check.result }}"
exit 1
fi
-81
View File
@@ -1,81 +0,0 @@
name: Publish to NPM
on:
push:
branches:
- master
env:
NODE_VERSION: 24.x
jobs:
check-and-publish:
name: Check version changes and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
run_install: false
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browser
run: pnpm --filter "@robonen/primitives" exec playwright install --with-deps chromium
- name: Build & Test
run: pnpm build && pnpm test
- name: Check for version changes and publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# Find all package.json files (excluding node_modules)
PACKAGE_FILES=$(find . -path "*/package.json" -not -path "*/node_modules/*")
for file in $PACKAGE_FILES; do
PACKAGE_DIR=$(dirname $file)
echo "Checking $PACKAGE_DIR for version changes..."
# Get package details
PACKAGE_NAME=$(node -p "require('$file').name")
CURRENT_VERSION=$(node -p "require('$file').version")
IS_PRIVATE=$(node -p "require('$file').private || false")
# Skip private packages
if [ "$IS_PRIVATE" == "true" ]; then
echo "Skipping private package $PACKAGE_NAME"
continue
fi
# Skip root package
if [ "$PACKAGE_DIR" == "." ]; then
echo "Skipping root package"
continue
fi
# Check if package exists on npm
NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "0.0.0")
# Compare versions
if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
echo "Version changed for $PACKAGE_NAME: $NPM_VERSION → $CURRENT_VERSION"
echo "Publishing $PACKAGE_NAME@$CURRENT_VERSION"
cd $PACKAGE_DIR
pnpm publish --access public --no-git-checks
cd -
else
echo "No version change detected for $PACKAGE_NAME"
fi
done