Migrate SharedCode consumers to Gitea packages
This commit is contained in:
1 parent
a988fdee44
commit
d4dce959f9
6 files changed
+3675
-3709
No files matched your search
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
@@ -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/ ./
|
||||||
|
|||||||
Generated
+3639
-3632
File diff suppressed because it is too large.
Load diff
@@ -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",
|
||||||
|
|||||||
Reference in new issue
Block a user