- Add PGlite (embedded Postgres) for local tier — gateway runs without external PG server. Same schema, same Drizzle API, zero module refactor. - Install wizard now offers tier selection (local vs team). Local skips DATABASE_URL/VALKEY_URL, writes mosaic.config.json. - Comment out npmjs publish step in CI (preserved for future use). - Revert gateway publishConfig to Gitea registry, include in Gitea publish. - Add repository field to all 23 publishable package.json files for Gitea package-to-repo linking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
112 lines
3.7 KiB
YAML
112 lines
3.7 KiB
YAML
# Build, publish npm packages, and push Docker images
|
|
# Runs only on main branch push/tag
|
|
|
|
variables:
|
|
- &node_image 'node:22-alpine'
|
|
- &enable_pnpm 'corepack enable'
|
|
|
|
when:
|
|
- branch: [main]
|
|
event: [push, manual, tag]
|
|
|
|
steps:
|
|
install:
|
|
image: *node_image
|
|
commands:
|
|
- corepack enable
|
|
- pnpm install --frozen-lockfile
|
|
|
|
build:
|
|
image: *node_image
|
|
commands:
|
|
- *enable_pnpm
|
|
- pnpm build
|
|
depends_on:
|
|
- install
|
|
|
|
publish-npm:
|
|
image: *node_image
|
|
environment:
|
|
NPM_TOKEN:
|
|
from_secret: gitea_token
|
|
commands:
|
|
- *enable_pnpm
|
|
# Configure auth for Gitea npm registry
|
|
- |
|
|
echo "//git.mosaicstack.dev/api/packages/mosaic/npm/:_authToken=$NPM_TOKEN" > ~/.npmrc
|
|
echo "@mosaic:registry=https://git.mosaicstack.dev/api/packages/mosaic/npm/" >> ~/.npmrc
|
|
# Publish non-private packages to Gitea (--no-git-checks skips dirty/branch checks in CI)
|
|
# --filter excludes web (private)
|
|
- >
|
|
pnpm --filter "@mosaic/*"
|
|
--filter "!@mosaic/web"
|
|
publish --no-git-checks --access public
|
|
|| echo "[publish] Some packages may already exist at this version — continuing"
|
|
depends_on:
|
|
- build
|
|
|
|
# TODO: Uncomment when ready to publish to npmjs.org
|
|
# publish-npmjs:
|
|
# image: *node_image
|
|
# environment:
|
|
# NPM_TOKEN:
|
|
# from_secret: npmjs_token
|
|
# commands:
|
|
# - *enable_pnpm
|
|
# - apk add --no-cache jq bash
|
|
# - bash scripts/publish-npmjs.sh
|
|
# depends_on:
|
|
# - build
|
|
# when:
|
|
# - event: [tag]
|
|
|
|
build-gateway:
|
|
image: gcr.io/kaniko-project/executor:debug
|
|
environment:
|
|
REGISTRY_USER:
|
|
from_secret: gitea_username
|
|
REGISTRY_PASS:
|
|
from_secret: gitea_password
|
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
|
commands:
|
|
- mkdir -p /kaniko/.docker
|
|
- echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json
|
|
- |
|
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/mosaic-stack/gateway:sha-${CI_COMMIT_SHA:0:7}"
|
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/gateway:latest"
|
|
fi
|
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/gateway:$CI_COMMIT_TAG"
|
|
fi
|
|
/kaniko/executor --context . --dockerfile docker/gateway.Dockerfile $DESTINATIONS
|
|
depends_on:
|
|
- build
|
|
|
|
build-web:
|
|
image: gcr.io/kaniko-project/executor:debug
|
|
environment:
|
|
REGISTRY_USER:
|
|
from_secret: gitea_username
|
|
REGISTRY_PASS:
|
|
from_secret: gitea_password
|
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
|
commands:
|
|
- mkdir -p /kaniko/.docker
|
|
- echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json
|
|
- |
|
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/mosaic-stack/web:sha-${CI_COMMIT_SHA:0:7}"
|
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/web:latest"
|
|
fi
|
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/web:$CI_COMMIT_TAG"
|
|
fi
|
|
/kaniko/executor --context . --dockerfile docker/web.Dockerfile $DESTINATIONS
|
|
depends_on:
|
|
- build
|