Skip to content

feat: install via get.ararahq.com (Cloudflare Worker) + fix release pipeline - #1

Merged
micaelmrq merged 2 commits into
mainfrom
feat/get-ararahq-install-worker
May 25, 2026
Merged

micaelmrq merged 2 commits into
mainfrom
feat/get-ararahq-install-worker

Conversation

@micaelmrq

Copy link
Copy Markdown
Member

Summary

3 mudanças necessárias pra curl -fsSL https://get.ararahq.com/install-cli | sh funcionar:

1. Cloudflare Worker (workers/install-cli/)

Worker stateless que serve os install scripts:

Route Resposta
GET / install.sh se UA é curl/wget, senão 302 → docs.ararahq.com/cli
GET /install-cli install.sh
GET /install-cli.sh install.sh
GET /install-cli.ps1 install.ps1

Proxy pra raw.githubusercontent.com/ararahq/cli/main/install.{sh,ps1}, cache 5min na borda. Deploy via wrangler deploy + custom domain get.ararahq.com no dashboard CF.

2. Fix bug em .goreleaser.yaml

release.github.name estava arara-cli (legado), mas o repo se chama cli. Era isso que fazia o release v0.1.0 falhar em publicar release oficial na URL certa. Corrigido pra cli.

3. Fix em .github/workflows/release.yml

Antes: workflow falhava completo se DOCKERHUB_USERNAME ou TAP_GITHUB_TOKEN não estivessem setados. (Foi o que matou o release de v0.1.0.)

Agora: detecta secrets ausentes e passa --skip=docker e/ou --skip=homebrew,scoop pro goreleaser. Permite primeiro release público com só GitHub Releases — Docker e Homebrew entram automaticamente quando você adicionar os secrets.

Próximos passos (manuais, fora deste PR)

  • wrangler login + cd workers/install-cli && wrangler deploy
  • Dashboard CF → Worker arara-install-cli → Triggers → Add Custom Domain → get.ararahq.com
  • Deletar tag remota v0.1.0 (release antigo falhou) → git tag -d v0.1.0 && git push origin :v0.1.0
  • Recriar tag v0.1.0 → CI dispara goreleaser → release público com binários linux/darwin/windows × amd64/arm64
  • (Opcional) Criar repo vazio ararahq/homebrew-tap + adicionar secret TAP_GITHUB_TOKEN (PAT com scope repo)
  • (Opcional) Adicionar DOCKERHUB_USERNAME + DOCKERHUB_TOKEN

Test plan

  • wrangler dev local + curl http://127.0.0.1:8787/install-cli retorna o install.sh
  • Após deploy: curl -fsSL https://get.ararahq.com/install-cli | head -20 mostra o shebang #!/bin/sh
  • curl -fsSL https://get.ararahq.com | head -20 (sem path) também retorna o script (User-Agent: curl)
  • https://get.ararahq.com no browser redireciona pra docs.ararahq.com/cli (User-Agent: navegador)
  • Após primeiro release: curl -fsSL https://get.ararahq.com/install-cli | sh instala o binário em /usr/local/bin

🤖 Generated with Claude Code

micaelmrq added 2 commits May 25, 2026 17:12
…ipeline

## Cloudflare Worker
Novo worker em `workers/install-cli/` que serve install scripts em get.ararahq.com:

- GET /                      → install.sh quando UA é curl/wget; senão 302 docs
- GET /install-cli           → install.sh (Unix)
- GET /install-cli.sh        → install.sh (Unix)
- GET /install-cli.ps1       → install.ps1 (Windows)

Proxy pra raw.githubusercontent.com/ararahq/cli/main/install.{sh,ps1} com cache
de 5min na borda. Deploy via wrangler. Custom domain `get.ararahq.com`
configurado pelo dashboard.

## Fix .goreleaser.yaml
release.github.name estava como "arara-cli" mas o repo se chama "cli" — release
falhava silenciosamente. Corrige pra "cli".

## Fix .github/workflows/release.yml
Pula Docker Hub e Homebrew/Scoop quando os secrets correspondentes não estão
configurados (antes goreleaser falhava o release inteiro nesse caso). Permite
publicar o primeiro release com só GitHub Releases; brews/docker entram quando
os secrets forem adicionados.
3 falhas no CI deste PR:

- govulncheck reportou 7 CVEs do stdlib (crypto/tls, archive/tar, crypto/x509)
  fixadas em go1.26.2. Bump go.mod.

- golangci-lint v1.64.5 (foi buildado com go1.24) recusa um projeto declarado
  como go1.26: "the Go language version (go1.24) used to build golangci-lint
  is lower than the targeted Go version (1.26.1)". Sobe pra v2.12.2 — config
  ja esta em formato v2 (.golangci.yml com version: "2").

- test (windows-latest) falha no PowerShell parseando `coverage.out` como
  propriedade de objeto: "FAIL .out [setup failed] / no required module
  provides package .out". Forca shell bash (Git Bash existe no runner Windows
  do GitHub Actions) tanto no build quanto no test.
@micaelmrq
micaelmrq merged commit 0a92801 into main May 25, 2026
2 of 5 checks passed
@micaelmrq
micaelmrq deleted the feat/get-ararahq-install-worker branch May 25, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant