Files
LexAI/.gitea/workflows/ci.yml
Forge 7732aace54
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 35s
fix: clone to /tmp/lexai - avoid mounted workspace volume conflicts
2026-03-06 13:52:30 +08:00

63 lines
1.9 KiB
YAML

name: CI — Test & Build
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test-and-build:
name: Test & Build
runs-on: ubuntu-latest
container:
image: node:22-bookworm
steps:
- name: Install system deps
run: apt-get update -qq && apt-get install -y zip curl git ca-certificates -qq
- name: Clone repository
run: |
git config --global http.sslVerify false
git clone --depth 1 --branch main ${{ gitea.server_url }}/${{ gitea.repository }}.git /tmp/lexai
- name: Install dependencies
run: npm ci
working-directory: /tmp/lexai
- name: Type check
run: npm run typecheck
working-directory: /tmp/lexai
- name: Run unit tests
run: npm test -- --run
working-directory: /tmp/lexai
- name: Build extension
run: npm run build
working-directory: /tmp/lexai
- name: Verify build output
run: ls -la .output/chrome-mv3/
working-directory: /tmp/lexai
- name: Package as ZIP
run: |
SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
VERSION=$(node -p "require('./package.json').version")-${SHA}
zip -r /tmp/lexai-chrome-mv3-${VERSION}.zip .output/chrome-mv3/
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
echo "✅ Packaged: lexai-chrome-mv3-${VERSION}.zip"
working-directory: /tmp/lexai
- name: Publish to Gitea Package Registry
run: |
curl -f -s -X PUT \
"${{ gitea.server_url }}/api/packages/kibin/generic/lexai-extension/${PACKAGE_VERSION}/lexai-chrome-mv3-${PACKAGE_VERSION}.zip" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-T "/tmp/lexai-chrome-mv3-${PACKAGE_VERSION}.zip"
echo "✅ Published: https://git.juankibin.space/kibin/-/packages"
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}