- embedded/web/package.json: publish as @lotusguild/element-call-embedded
from our Gitea fork (repository URL updated).
- .gitea/workflows/ci.yml: build the embedded bundle on PR/push to lotus;
publish to the Gitea npm registry on a v* tag. Linux-only (web bundle).
Based on upstream element-call v0.20.1 (2d74c48).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
105 lines
3.3 KiB
YAML
105 lines
3.3 KiB
YAML
name: CI
|
|
|
|
# Build + publish the Lotus fork of Element Call's embedded web bundle.
|
|
# Models LotusGuild/cinny's .gitea/workflows/ci.yml. Web bundle only, so
|
|
# Linux-only (the Windows worker is for cinny-desktop / Tauri, not needed here).
|
|
#
|
|
# - PRs and pushes to `lotus` -> build + smoke-check the embedded dist
|
|
# - Pushes of a tag `v*` -> build + publish @lotusguild/element-call-embedded
|
|
# to the Gitea npm registry
|
|
#
|
|
# Versioning mirrors upstream: the in-repo package.json stays 0.0.0; the
|
|
# published version is derived from the git tag at publish time.
|
|
|
|
on:
|
|
push:
|
|
branches: [lotus]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [lotus]
|
|
|
|
env:
|
|
# element-call's build:full sets 16384 already; keep parity for safety.
|
|
NODE_OPTIONS: '--max-old-space-size=16384'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build embedded bundle
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.node-version' # Node 24
|
|
# registry-url wires up the Gitea-scoped registry + auth for publish
|
|
registry-url: 'https://code.lotusguild.org/api/packages/LotusGuild/npm/'
|
|
scope: '@lotusguild'
|
|
|
|
- name: Enable corepack (pnpm from packageManager field)
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build embedded
|
|
run: pnpm run build:embedded
|
|
|
|
- name: Smoke-check output
|
|
run: |
|
|
test -f embedded/web/dist/index.html
|
|
test -d embedded/web/dist/assets
|
|
echo "### Embedded bundle" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "" >> "$GITHUB_STEP_SUMMARY"
|
|
echo '```' >> "$GITHUB_STEP_SUMMARY"
|
|
du -sh embedded/web/dist >> "$GITHUB_STEP_SUMMARY"
|
|
ls embedded/web/dist >> "$GITHUB_STEP_SUMMARY"
|
|
echo '```' >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Upload dist artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: element-call-embedded-dist
|
|
path: embedded/web/dist
|
|
retention-days: 7
|
|
|
|
publish:
|
|
name: Publish to Gitea npm registry
|
|
needs: build
|
|
# Only on a version tag push, never on PRs.
|
|
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.node-version'
|
|
registry-url: 'https://code.lotusguild.org/api/packages/LotusGuild/npm/'
|
|
scope: '@lotusguild'
|
|
|
|
- name: Enable corepack
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build embedded
|
|
run: pnpm run build:embedded
|
|
|
|
- name: Set published version from tag
|
|
working-directory: embedded/web
|
|
run: |
|
|
TAG="${GITHUB_REF_NAME#v}" # v0.20.1 -> 0.20.1
|
|
npm version "$TAG" --no-git-tag-version --allow-same-version
|
|
|
|
- name: Publish
|
|
working-directory: embedded/web
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITEA_NPM_TOKEN }}
|
|
run: npm publish --access public
|