Files
teletypegames/.woodpecker.yaml
T
mr.zeroandClaude Opus 5 2b62070557
ci/woodpecker/tag/woodpecker Pipeline was successful
Give gem push a named credentials key
The push prompted for credentials and then died with "404 page not
found". Both are the same fault: RubyGems normalizes the keys in
~/.gem/credentials — dots become __ and a trailing slash is appended —
so a key written as the host URL can never match the --host value.
Finding no key, gem push falls back to signing in against the RubyGems
sign_in endpoint, which Gitea does not implement; that is the 404.

A named key is stored verbatim and is matched by --key, so the lookup
succeeds. Verified against Gem::ConfigFile with both formats.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 11:11:17 +02:00

63 lines
2.2 KiB
YAML

# Read-only split mirror: a libs/ruby/warp_engine alkönyvtárat kitükrözi a
# engines/warp_engine repóba (fejlesztés itt, a monorepóban történik; a tükör
# csak publikálásra való). Tag-elt release (warp_engine-v*) esetén a gem a
# Forgejo rubygems registry-be is felmegy.
#
# Szükséges Woodpecker secret: forge_token — Forgejo access token
# repository:write (engines/warp_engine) és package:write joggal.
when:
- event: push
branch: master
path: "libs/ruby/warp_engine/**"
- event: manual
- event: tag
ref: refs/tags/warp_engine-v*
clone:
git:
image: woodpeckerci/plugin-git
settings:
partial: false
depth: 0 # a subtree splithez teljes history kell
steps:
split-mirror:
image: alpine/git
environment:
FORGE_TOKEN:
from_secret: forge_token
commands:
- apk add --no-cache git-subtree
- git subtree split --prefix=libs/ruby/warp_engine HEAD -b warp-engine-split
# a secretbe másolt token végén lehet sortörés — levágjuk
- TOKEN="$$(printf '%s' "$${FORGE_TOKEN}" | tr -d '[:space:]')"
- git push --force "https://ci:$${TOKEN}@git.teletypegames.org/engines/warp_engine.git" warp-engine-split:master
when:
- event: push
branch: master
- event: manual
publish-gem:
image: ruby:3.3-slim
environment:
FORGE_TOKEN:
from_secret: forge_token
commands:
- cd libs/ruby/warp_engine
- gem build warp_engine.gemspec
- mkdir -p ~/.gem
- TOKEN="$$(printf '%s' "$${FORGE_TOKEN}" | tr -d '[:space:]')"
# Nevesített kulcs, nem a hoszt-URL: a RubyGems a credentials fájl
# kulcsait normalizálja (a pontokból __ lesz, záró perjelet kap), így egy
# URL-kulcs sosem egyezik a --host értékével. Ilyenkor a gem push
# bejelentkezni próbál a RubyGems sign_in végpontján, amit a Gitea nem
# ismer — ez adta a "404 page not found"-ot.
- |
printf -- '---\n:gitea: Bearer %s\n' "$${TOKEN}" > ~/.gem/credentials
- chmod 600 ~/.gem/credentials
- gem push --key gitea --host https://git.teletypegames.org/api/packages/engines/rubygems warp_engine-*.gem
when:
- event: tag
ref: refs/tags/warp_engine-v*