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
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user