Migrate SharedCode consumers to Gitea packages
This commit is contained in:
1 parent
a988fdee44
commit
d4dce959f9
6 files changed
+55
-89
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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/ ./
|
||||
|
||||
Generated
+19
-12
@@ -8,7 +8,7 @@
|
||||
"name": "collabtable-server-frontend",
|
||||
"version": "1.0.0",
|
||||
"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",
|
||||
@@ -218,17 +218,6 @@
|
||||
"integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
|
||||
"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": {
|
||||
"version": "0.19.2",
|
||||
"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",
|
||||
"integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user