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
+55 -89

No files matched your search

+22 -24
View File
@@ -32,30 +32,6 @@ jobs:
uses: actions/checkout@v7 uses: actions/checkout@v7
with: with:
submodules: false 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) - name: Set up QEMU (multi-arch builds)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/setup-qemu-action@v4 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 'GOPROXY=https://repos.gfranz.ch/api/packages/Gabriel20xx/go,https://proxy.golang.org\n'
printf 'GONOSUMDB=repos.gfranz.ch/Gabriel20xx/shared/*\n' printf 'GONOSUMDB=repos.gfranz.ch/Gabriel20xx/shared/*\n'
} >> "$GITHUB_ENV" } >> "$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 - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4 uses: docker/setup-buildx-action@v4
@@ -109,6 +106,7 @@ jobs:
uses: docker/build-push-action@v7 uses: docker/build-push-action@v7
with: with:
secret-files: | secret-files: |
gitea_npmrc=${{ runner.temp }}/gitea-npmrc
gitea_go_netrc=${{ runner.temp }}/gitea-go.netrc gitea_go_netrc=${{ runner.temp }}/gitea-go.netrc
context: . context: .
file: ./docker/Dockerfile file: ./docker/Dockerfile
+5 -16
View File
@@ -18,6 +18,9 @@ on:
- '.github/workflows/lint.yml' - '.github/workflows/lint.yml'
workflow_dispatch: {} workflow_dispatch: {}
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
jobs: jobs:
lint: lint:
name: Lint name: Lint
@@ -33,25 +36,11 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: false 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 - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
registry-url: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
scope: '@gabriel20xx'
node-version: '20' node-version: '20'
cache: 'npm' cache: 'npm'
cache-dependency-path: frontend/package-lock.json cache-dependency-path: frontend/package-lock.json
+5 -32
View File
@@ -18,6 +18,9 @@ on:
- '.github/workflows/tests.yml' - '.github/workflows/tests.yml'
workflow_dispatch: {} workflow_dispatch: {}
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
jobs: jobs:
backend: backend:
name: Go backend name: Go backend
@@ -33,22 +36,6 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: false 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 - name: Configure Gitea Go registry
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
shell: bash shell: bash
@@ -97,25 +84,11 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: false 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 - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
registry-url: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
scope: '@gabriel20xx'
node-version: '22' node-version: '22'
cache: npm cache: npm
cache-dependency-path: frontend/package-lock.json cache-dependency-path: frontend/package-lock.json
+3 -4
View File
@@ -1,14 +1,13 @@
FROM node:22-alpine AS frontend-builder FROM node:22-alpine AS frontend-builder
RUN apk add --no-cache git
WORKDIR /frontend WORKDIR /frontend
COPY frontend/package*.json ./ COPY frontend/package*.json ./
RUN --mount=type=bind,source=SharedCode.git,target=/tmp/SharedCode.git,readonly \ RUN --mount=type=cache,target=/root/.npm \
git config --global url."file:///tmp/SharedCode.git".insteadOf "https://repos.gfranz.ch/Gabriel20xx/shared" && \ --mount=type=secret,id=gitea_npmrc,target=/root/.npmrc,required \
for attempt in 1 2 3 4 5; do \ for attempt in 1 2 3 4 5; do \
npm ci && break; \ npm ci && break; \
if [ "$attempt" -eq 5 ]; then exit 1; fi; \ if [ "$attempt" -eq 5 ]; then exit 1; fi; \
delay=$((attempt * 5)); \ 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"; \ sleep "$delay"; \
done done
COPY frontend/ ./ COPY frontend/ ./
+19 -12
View File
@@ -8,7 +8,7 @@
"name": "collabtable-server-frontend", "name": "collabtable-server-frontend",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@gabriel20xx/shared-code": "git+https://repos.gfranz.ch/Gabriel20xx/shared#main", "@gabriel20xx/web-ui": "0.1.0",
"@lucide/svelte": "latest", "@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest", "@tanstack/svelte-query": "latest",
"bits-ui": "latest", "bits-ui": "latest",
@@ -218,17 +218,6 @@
"integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@gabriel20xx/shared-code": {
"version": "0.1.0",
"resolved": "git+https://repos.gfranz.ch/Gabriel20xx/shared#main",
"license": "MIT",
"workspaces": [
"packages/*"
],
"dependencies": {
"pg": "^8.17.2"
}
},
"node_modules/@humanfs/core": { "node_modules/@humanfs/core": {
"version": "0.19.2", "version": "0.19.2",
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
@@ -3627,6 +3616,24 @@
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz",
"integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==",
"license": "MIT" "license": "MIT"
},
"node_modules/@gabriel20xx/design-tokens": {
"version": "0.1.0",
"resolved": "https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/@gabriel20xx/design-tokens/-/design-tokens-0.1.0.tgz",
"integrity": "sha512-G8IjBK+q7dqJfPlkiNQmgFa92F/cG988iyf52KIHYlReF5KCS1txVXx+/iAAGFH97tv2UYekvbbMi7oQLREdcQ==",
"license": "MIT"
},
"node_modules/@gabriel20xx/web-ui": {
"version": "0.1.0",
"resolved": "https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/@gabriel20xx/web-ui/-/web-ui-0.1.0.tgz",
"integrity": "sha512-sVAfO6x36/A6R5aSVZlNujZgh4V0EkWvWl2PxcUCc6TPGTHLvgcM1GNr+g0XeIxh0yyRPHOMD8+cy1jOcTB7aw==",
"license": "MIT",
"dependencies": {
"@gabriel20xx/design-tokens": "0.1.0"
},
"peerDependencies": {
"svelte": "^5.0.0"
}
} }
} }
} }
+1 -1
View File
@@ -30,7 +30,7 @@
"vite": "latest" "vite": "latest"
}, },
"dependencies": { "dependencies": {
"@gabriel20xx/shared-code": "git+https://repos.gfranz.ch/Gabriel20xx/shared#main", "@gabriel20xx/web-ui": "0.1.0",
"@lucide/svelte": "latest", "@lucide/svelte": "latest",
"@tanstack/svelte-query": "latest", "@tanstack/svelte-query": "latest",
"bits-ui": "latest", "bits-ui": "latest",