ci: fetch private repo archive via API and run from .repo
This commit is contained in:
parent
813de8e2a9
commit
9c2e671988
1 changed files with 14 additions and 7 deletions
|
|
@ -36,19 +36,21 @@ jobs:
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf .src
|
rm -rf .repo
|
||||||
mkdir -p .src
|
mkdir -p .repo
|
||||||
|
|
||||||
|
# Use the authenticated API archive endpoint (works for private repos).
|
||||||
curl -fsSL -H "Authorization: token ${GITHUB_TOKEN}" \
|
curl -fsSL -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||||
"https://codeberg.org/every-channel/every.channel/archive/${GITHUB_SHA}.tar.gz" \
|
"https://codeberg.org/api/v1/repos/every-channel/every.channel/archive/${GITHUB_SHA}.tar.gz?rev=${GITHUB_SHA}" \
|
||||||
-o .src/src.tgz
|
-o .repo/src.tgz
|
||||||
tar -xzf .src/src.tgz -C .src --strip-components=1
|
tar -xzf .repo/src.tgz -C .repo --strip-components=1
|
||||||
rsync -a .src/ ./
|
rm -f .repo/src.tgz
|
||||||
rm -rf .src
|
|
||||||
|
|
||||||
- name: Bootstrap runner deps
|
- name: Bootstrap runner deps
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd .repo
|
||||||
install -d -m 755 "$HOME/.local/bin"
|
install -d -m 755 "$HOME/.local/bin"
|
||||||
echo "PATH=$HOME/.local/bin:$PATH" >> "$GITHUB_ENV"
|
echo "PATH=$HOME/.local/bin:$PATH" >> "$GITHUB_ENV"
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
@ -105,6 +107,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd .repo
|
||||||
curl -fsSL -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
|
curl -fsSL -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||||
-H "content-type: application/json" \
|
-H "content-type: application/json" \
|
||||||
"https://codeberg.org/api/v1/repos/every-channel/every.channel/statuses/${GITHUB_SHA}" \
|
"https://codeberg.org/api/v1/repos/every-channel/every.channel/statuses/${GITHUB_SHA}" \
|
||||||
|
|
@ -116,6 +119,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd .repo
|
||||||
if [[ -z "${AGE_FORGE_SSH_KEY:-}" ]]; then
|
if [[ -z "${AGE_FORGE_SSH_KEY:-}" ]]; then
|
||||||
echo "error: missing Actions secret AGE_FORGE_SSH_KEY"
|
echo "error: missing Actions secret AGE_FORGE_SSH_KEY"
|
||||||
exit 2
|
exit 2
|
||||||
|
|
@ -132,6 +136,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd .repo
|
||||||
key_file="$HOME/.ssh/age_forge_ed25519"
|
key_file="$HOME/.ssh/age_forge_ed25519"
|
||||||
secret_file="secrets/cloudflare-api-token.age"
|
secret_file="secrets/cloudflare-api-token.age"
|
||||||
if [[ ! -f "$secret_file" ]]; then
|
if [[ ! -f "$secret_file" ]]; then
|
||||||
|
|
@ -150,6 +155,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd .repo
|
||||||
install -d -m 755 "$HOME/.local/bin"
|
install -d -m 755 "$HOME/.local/bin"
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
if ! command -v cargo >/dev/null 2>&1; then
|
if ! command -v cargo >/dev/null 2>&1; then
|
||||||
|
|
@ -183,6 +189,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
cd .repo
|
||||||
cd ../../../deploy/cloudflare-worker
|
cd ../../../deploy/cloudflare-worker
|
||||||
npm ci
|
npm ci
|
||||||
npx wrangler deploy
|
npx wrangler deploy
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue