Use versioned shared module and registry credentials
This commit is contained in:
1 parent
b2ffa39148
commit
a988fdee44
10 files changed
+70
-17
No files matched your search
@@ -38,7 +38,7 @@ jobs:
|
||||
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/SharedCode SharedCode; then
|
||||
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/shared SharedCode; then
|
||||
break
|
||||
fi
|
||||
if [ "$attempt" -eq 5 ]; then
|
||||
@@ -49,6 +49,31 @@ jobs:
|
||||
sleep "$delay"
|
||||
done
|
||||
|
||||
- name: Configure Gitea Go 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
|
||||
netrc_path="$RUNNER_TEMP/gitea-go.netrc"
|
||||
umask 077
|
||||
{
|
||||
printf 'machine repos.gfranz.ch\n'
|
||||
printf 'login %s\n' "$PACKAGE_REGISTRY_USERNAME"
|
||||
printf 'password %s\n' "$PACKAGE_REGISTRY_TOKEN"
|
||||
} > "$netrc_path"
|
||||
{
|
||||
printf 'NETRC=%s\n' "$netrc_path"
|
||||
printf 'GOAUTH=netrc\n'
|
||||
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: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
@@ -77,7 +102,7 @@ jobs:
|
||||
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/SharedCode SharedCode; then
|
||||
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/shared SharedCode; then
|
||||
break
|
||||
fi
|
||||
if [ "$attempt" -eq 5 ]; then
|
||||
|
||||
Reference in new issue
Block a user