Migrate SharedCode consumers to Gitea packages
Docker / Docker Build & Push (push) Failing after 48s
Lint / Lint (push) Successful in 14s
Tests / Go backend (push) Failing after 15s
Tests / Dashboard checks (push) Successful in 17s

This commit is contained in:
Gabriel20xx committed 2026-08-06 12:22:44 +02:00
1 parent a988fdee44
commit d4dce959f9
6 files changed
+3675 -3709

No files matched your search

+22 -24
View File
@@ -32,30 +32,6 @@ jobs:
uses: actions/checkout@v7
with:
submodules: false
- name: Checkout latest SharedCode
working-directory: ${{ github.workspace }}
run: |
for attempt in 1 2 3 4 5; do
rm -rf SharedCode
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/shared SharedCode; then
break
fi
if [ "$attempt" -eq 5 ]; then
exit 1
fi
delay=$((attempt * 5))
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
sleep "$delay"
done
- name: Prepare SharedCode Git mirror for Docker
working-directory: ${{ github.workspace }}
run: |
rm -rf SharedCode.git
git clone --bare --branch main --single-branch SharedCode SharedCode.git
# Multi-arch (arm64) is only built and published from main; other branches and PRs
# only need an amd64 build to validate they compile, which needs no emulation.
- name: Set up QEMU (multi-arch builds)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/setup-qemu-action@v4
@@ -85,6 +61,27 @@ jobs:
printf 'GOPROXY=https://repos.gfranz.ch/api/packages/Gabriel20xx/go,https://proxy.golang.org\n'
printf 'GONOSUMDB=repos.gfranz.ch/Gabriel20xx/shared/*\n'
} >> "$GITHUB_ENV"
- name: Configure Gitea npm registry
working-directory: ${{ github.workspace }}
shell: bash
env:
PACKAGE_REGISTRY_USERNAME: ${{ secrets.PACKAGE_REGISTRY_USERNAME }}
PACKAGE_REGISTRY_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
run: |
set -euo pipefail
if [ -z "$PACKAGE_REGISTRY_USERNAME" ] || [ -z "$PACKAGE_REGISTRY_TOKEN" ]; then
echo 'PACKAGE_REGISTRY_USERNAME and PACKAGE_REGISTRY_TOKEN secrets are required.' >&2
exit 1
fi
npmrc_path="$RUNNER_TEMP/gitea-npmrc"
umask 077
{
printf '@gabriel20xx:registry=https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/\n'
printf '//repos.gfranz.ch/api/packages/Gabriel20xx/npm/:_authToken=%s\n' "$PACKAGE_REGISTRY_TOKEN"
printf 'always-auth=true\n'
} > "$npmrc_path"
printf 'NPM_CONFIG_USERCONFIG=%s\n' "$npmrc_path" >> "$GITHUB_ENV"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
@@ -109,6 +106,7 @@ jobs:
uses: docker/build-push-action@v7
with:
secret-files: |
gitea_npmrc=${{ runner.temp }}/gitea-npmrc
gitea_go_netrc=${{ runner.temp }}/gitea-go.netrc
context: .
file: ./docker/Dockerfile
+5 -16
View File
@@ -18,6 +18,9 @@ on:
- '.github/workflows/lint.yml'
workflow_dispatch: {}
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
jobs:
lint:
name: Lint
@@ -33,25 +36,11 @@ jobs:
uses: actions/checkout@v4
with:
submodules: false
- name: Checkout latest SharedCode
working-directory: ${{ github.workspace }}
run: |
for attempt in 1 2 3 4 5; do
rm -rf SharedCode
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/shared SharedCode; then
break
fi
if [ "$attempt" -eq 5 ]; then
exit 1
fi
delay=$((attempt * 5))
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
sleep "$delay"
done
- name: Setup Node.js
uses: actions/setup-node@v4
with:
registry-url: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
scope: '@gabriel20xx'
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
+5 -32
View File
@@ -18,6 +18,9 @@ on:
- '.github/workflows/tests.yml'
workflow_dispatch: {}
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
jobs:
backend:
name: Go backend
@@ -33,22 +36,6 @@ jobs:
uses: actions/checkout@v4
with:
submodules: false
- name: Checkout latest SharedCode
working-directory: ${{ github.workspace }}
run: |
for attempt in 1 2 3 4 5; do
rm -rf SharedCode
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/shared SharedCode; then
break
fi
if [ "$attempt" -eq 5 ]; then
exit 1
fi
delay=$((attempt * 5))
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
sleep "$delay"
done
- name: Configure Gitea Go registry
working-directory: ${{ github.workspace }}
shell: bash
@@ -97,25 +84,11 @@ jobs:
uses: actions/checkout@v4
with:
submodules: false
- name: Checkout latest SharedCode
working-directory: ${{ github.workspace }}
run: |
for attempt in 1 2 3 4 5; do
rm -rf SharedCode
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/shared SharedCode; then
break
fi
if [ "$attempt" -eq 5 ]; then
exit 1
fi
delay=$((attempt * 5))
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
sleep "$delay"
done
- name: Set up Node.js
uses: actions/setup-node@v4
with:
registry-url: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
scope: '@gabriel20xx'
node-version: '22'
cache: npm
cache-dependency-path: frontend/package-lock.json
+3 -4
View File
@@ -1,14 +1,13 @@
FROM node:22-alpine AS frontend-builder
RUN apk add --no-cache git
WORKDIR /frontend
COPY frontend/package*.json ./
RUN --mount=type=bind,source=SharedCode.git,target=/tmp/SharedCode.git,readonly \
git config --global url."file:///tmp/SharedCode.git".insteadOf "https://repos.gfranz.ch/Gabriel20xx/shared" && \
RUN --mount=type=cache,target=/root/.npm \
--mount=type=secret,id=gitea_npmrc,target=/root/.npmrc,required \
for attempt in 1 2 3 4 5; do \
npm ci && break; \
if [ "$attempt" -eq 5 ]; then exit 1; fi; \
delay=$((attempt * 5)); \
echo "SharedCode npm install failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2; \
echo "Gitea npm install failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2; \
sleep "$delay"; \
done
COPY frontend/ ./
+3639 -3632
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -30,7 +30,7 @@
"vite": "latest"
},
"dependencies": {
"@gabriel20xx/shared-code": "git+https://repos.gfranz.ch/Gabriel20xx/shared#main",
"@gabriel20xx/web-ui": "0.1.0",
"@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest",
"bits-ui": "latest",