fix: ci workflow - fix working-directory, git clone path, env var passing
Some checks failed
CI — Test & Build / Test & Build (push) Failing after 10s

This commit is contained in:
Forge
2026-03-06 13:45:14 +08:00
parent 33531398e1
commit 7713fb1b1d

View File

@@ -14,42 +14,55 @@ jobs:
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: Checkout
run: |
git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git .
git config --global http.sslVerify false
git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git /workspace
cd /workspace
git checkout ${{ gitea.sha }}
working-directory: /
- name: Install dependencies
run: npm ci
working-directory: /workspace
- name: Type check
run: npm run typecheck
working-directory: /workspace
- name: Run unit tests
run: npm test -- --run
- name: Install zip
run: apt-get update -qq && apt-get install -y zip
working-directory: /workspace
- name: Build extension
run: npm run build
working-directory: /workspace
- name: Verify build output
run: |
echo "Build contents:"
echo "Build contents:"
ls -la .output/chrome-mv3/
echo "✅ Build successful"
working-directory: /workspace
- name: Package as ZIP
run: |
VERSION=$(node -p "require('./package.json').version")-$(echo ${{ gitea.sha }} | cut -c1-7)
SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
VERSION=$(node -p "require('./package.json').version")-${SHA}
zip -r lexai-chrome-mv3-${VERSION}.zip .output/chrome-mv3/
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
echo "✅ Packaged: lexai-chrome-mv3-${VERSION}.zip"
working-directory: /workspace
- name: Publish to Gitea Package Registry
run: |
curl -s -X PUT "https://git.juankibin.space/api/packages/kibin/generic/lexai-extension/${{ env.VERSION }}/lexai-chrome-mv3-${{ env.VERSION }}.zip" \
cd /workspace
curl -f -s -X PUT \
"https://git.juankibin.space/api/packages/kibin/generic/lexai-extension/${PACKAGE_VERSION}/lexai-chrome-mv3-${PACKAGE_VERSION}.zip" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-T lexai-chrome-mv3-${{ env.VERSION }}.zip
echo "✅ Published lexai-chrome-mv3-${{ env.VERSION }}.zip to package registry"
echo "📦 Download: https://git.juankibin.space/kibin/LexAI/packages"
-T "lexai-chrome-mv3-${PACKAGE_VERSION}.zip"
echo "✅ Published to: https://git.juankibin.space/kibin/-/packages"
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}