10 Commits

Author SHA1 Message Date
b31d08c35d hhh
Some checks failed
Release / build (, amd64, darwin) (push) Successful in 49s
Release / build (, amd64, linux) (push) Successful in 51s
Release / build (, arm64, darwin) (push) Successful in 57s
Release / build (, arm64, linux) (push) Successful in 59s
Release / release (push) Failing after 33s
2026-03-31 03:36:31 -03:00
65293d0961 ddd
Some checks failed
Release / build (, amd64, darwin) (push) Successful in 49s
Release / build (, amd64, linux) (push) Successful in 55s
Release / build (, arm64, darwin) (push) Successful in 54s
Release / build (, arm64, linux) (push) Successful in 54s
Release / build (.exe, amd64, windows) (push) Failing after 45s
Release / release (push) Has been skipped
2026-03-31 03:29:59 -03:00
f9464c9def dd
Some checks failed
Release / build (, amd64, darwin) (push) Successful in 1m0s
Release / build (, amd64, linux) (push) Successful in 47s
Release / build (, arm64, darwin) (push) Successful in 51s
Release / build (, arm64, linux) (push) Successful in 59s
Release / build (.exe, amd64, windows) (push) Failing after 51s
Release / release (push) Has been skipped
2026-03-31 03:18:07 -03:00
Claudia CLI Bot
b6df678845 feat: Add main entry point and all CLI commands
Some checks failed
Release / build (, amd64, darwin) (push) Failing after 50s
Release / build (, amd64, linux) (push) Failing after 30s
Release / build (, arm64, darwin) (push) Failing after 40s
Release / build (, arm64, linux) (push) Failing after 31s
Release / build (.exe, amd64, windows) (push) Failing after 31s
Release / release (push) Has been skipped
- cmd/claudia-docs/main.go - entry point
- cobra/commands.go - CLI commands
- internal/api/ - HTTP client and API calls
- internal/auth/ - authentication
- internal/config/ - configuration
- internal/output/ - output formatting
- pkg/types/ - shared types
2026-03-31 06:12:09 +00:00
0d23a8b8b0 d
Some checks failed
Release / build (, amd64, darwin) (push) Failing after 38s
Release / build (, amd64, linux) (push) Failing after 13s
Release / build (, arm64, darwin) (push) Failing after 14s
Release / build (, arm64, linux) (push) Failing after 13s
Release / build (.exe, amd64, windows) (push) Failing after 14s
Release / release (push) Has been skipped
2026-03-31 02:53:50 -03:00
Claudia CLI Bot
17c9393b98 feat: Improve release workflow with install script, checksums and better packaging
Some checks failed
Release / build (, amd64, darwin) (push) Failing after 12s
Release / build (, amd64, linux) (push) Failing after 10s
Release / build (, arm64, darwin) (push) Failing after 9s
Release / build (, arm64, linux) (push) Failing after 9s
Release / build (.exe, amd64, windows) (push) Failing after 10s
Release / release (push) Has been skipped
Release / latest (push) Has been skipped
2026-03-31 05:16:06 +00:00
4eb68008b3 3
Some checks failed
Release / build (amd64, darwin, ) (push) Failing after 35s
Release / build (amd64, linux, ) (push) Failing after 10s
Release / build (amd64, windows, .exe) (push) Failing after 10s
Release / build (arm64, darwin, ) (push) Failing after 10s
Release / build (arm64, linux, ) (push) Failing after 9s
Release / release (push) Has been skipped
2026-03-31 01:46:03 -03:00
4258feab81 aaaa 2026-03-31 01:38:04 -03:00
fa6c44fcf1 ddd
Some checks failed
Release / build (push) Failing after 5m26s
Release / release (push) Has been skipped
2026-03-31 01:34:11 -03:00
3a50eac98e actualizacion 2026-03-31 01:06:38 -03:00
2 changed files with 176 additions and 84 deletions

View File

@@ -3,80 +3,37 @@ name: Release
on:
push:
tags:
- 'v*' # Se activa solo con tags como v1.0.0, v2.1.3, etc.
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0)'
required: false
type: string
env:
BINARY_NAME: claudia-docs
GO_VERSION: '1.22'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
suffix: ""
ext: ''
- goos: linux
goarch: arm64
suffix: ""
- goos: windows
goarch: amd64
suffix: ".exe"
ext: ''
- goos: darwin
goarch: amd64
suffix: ""
ext: ''
- goos: darwin
goarch: arm64
suffix: ""
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # necesario para git describe
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Compilar
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
# Nombre del binario: app-linux-amd64, app-windows-amd64.exe, etc.
BINARY_NAME="app-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}"
go build \
-ldflags="-w -s \
-X main.version=${{ gitea.ref_name }} \
-X main.commit=${{ gitea.sha }} \
-X main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o "dist/${BINARY_NAME}" \
./cmd/main.go
- name: Comprimir artefacto
run: |
cd dist
BINARY_NAME="app-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}"
if [ "${{ matrix.goos }}" = "windows" ]; then
zip "${BINARY_NAME%.exe}.zip" "${BINARY_NAME}"
else
tar -czf "${BINARY_NAME}.tar.gz" "${BINARY_NAME}"
fi
- name: Subir artefacto temporal
uses: actions/upload-artifact@v4
with:
name: bin-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*.tar.gz
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build # espera que todos los builds terminen
ext: ''
steps:
- name: Checkout
@@ -84,44 +41,166 @@ jobs:
with:
fetch-depth: 0
- name: Descargar todos los artefactos
uses: actions/download-artifact@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
path: dist/
merge-multiple: true
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Generar changelog desde commits
id: changelog
- name: Get version
id: version
run: |
# Obtener tag anterior
PREV_TAG=$(git tag --sort=-version:refname | sed -n '2p')
if [ -z "$PREV_TAG" ]; then
CHANGES=$(git log --pretty=format:"- %s (%h)" | head -20)
if [ -n "${{ gitea.event.inputs.version }}" ]; then
VERSION="${{ gitea.event.inputs.version }}"
else
CHANGES=$(git log "${PREV_TAG}..${{ gitea.ref_name }}" \
--pretty=format:"- %s (%h)")
VERSION="${{ gitea.ref_name }}"
fi
# Guardar en archivo para el siguiente paso
echo "${CHANGES}" > changelog.txt
echo "prev_tag=${PREV_TAG}" >> $GITEA_OUTPUT
echo "version=${VERSION#v}" >> $GITEA_OUTPUT
echo "tag=${VERSION}" >> $GITEA_OUTPUT
- name: Crear checksums
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
BINARY="${{ env.BINARY_NAME }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}"
mkdir -p dist
go build \
-ldflags="-w -s \
-X main.version=${{ steps.version.outputs.version }} \
-X main.commit=$(git rev-parse --short HEAD) \
-X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o "dist/${BINARY}" \
./cmd/claudia-docs
- name: Package
run: |
cd dist
sha256sum *.tar.gz *.zip 2>/dev/null > checksums.txt || \
sha256sum *.tar.gz > checksums.txt
BINARY="${{ env.BINARY_NAME }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}"
case "${{ matrix.goos }}" in
windows)
zip "${BINARY%.exe}.zip" "${BINARY}"
;;
*)
tar -czf "${BINARY}.tar.gz" "${BINARY}"
;;
esac
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
retention-days: 5
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(gitea.ref, 'refs/tags/v') || gitea.event.inputs.version != ''
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: version
run: |
if [ -n "${{ gitea.event.inputs.version }}" ]; then
VERSION="${{ gitea.event.inputs.version }}"
else
VERSION="${{ gitea.ref_name }}"
fi
echo "version=${VERSION#v}" >> $GITEA_OUTPUT
echo "tag=${VERSION}" >> $GITEA_OUTPUT
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: dist/
# ← sin merge-multiple, quedan en subdirectorios:
# dist/linux-amd64/claudia-docs-linux-amd64.tar.gz
# dist/windows-amd64/claudia-docs-windows-amd64.zip
# etc.
- name: Mover artefactos a dist/
run: |
find dist/ -mindepth 2 -type f \
\( -name "*.tar.gz" -o -name "*.zip" \) \
-exec mv {} dist/ \;
# Eliminar subdirectorios vacíos
find dist/ -mindepth 1 -type d -delete
ls -lh dist/
- name: Generate changelog
run: |
PREV_TAG=$(git tag --sort=-version:refname | sed -n '2p')
if [ -z "$PREV_TAG" ]; then
echo "# Changes (full history)" > changelog.md
git log --pretty=format:"- %s (%h)" -20 >> changelog.md
else
echo "# Changes since ${PREV_TAG}" > changelog.md
git log "${PREV_TAG}..${{ steps.version.outputs.tag }}" \
--pretty=format:"- %s (%h)" >> changelog.md
fi
cat changelog.md
- name: Generate checksums
run: |
cd dist
sha256sum *.tar.gz *.zip > checksums.txt
cat checksums.txt
- name: Crear Release en Gitea
- name: Generate install script
run: |
cat > install.sh << 'INSTALL_SCRIPT'
#!/bin/bash
set -e
VERSION="${VERSION:-latest}"
BINARY="claudia-docs"
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
esac
URL="https://gitea.danielarroyo.cl/proyectos/claudia-docs-cli/releases/download/${VERSION}/claudia-docs-${OS}-${ARCH}.tar.gz"
echo "Installing Claudia Docs CLI ${VERSION}..."
echo "Downloading from: ${URL}"
curl -fsSL "${URL}" | tar -xz
chmod +x "${BINARY}-${OS}-${ARCH}"
mv "${BINARY}-${OS}-${ARCH}" "${BINARY}"
if [ -w /usr/local/bin ]; then
mv "${BINARY}" /usr/local/bin/
echo "Installed to /usr/local/bin/claudia-docs"
else
echo "Run: sudo mv ${BINARY} /usr/local/bin/"
fi
echo "Done! Run: claudia-docs --version"
INSTALL_SCRIPT
chmod +x install.sh
- name: Create Release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
tag_name: ${{ gitea.ref_name }}
name: "Release ${{ gitea.ref_name }}"
body_path: changelog.txt
tag_name: ${{ steps.version.outputs.tag }}
name: "Claudia Docs CLI ${{ steps.version.outputs.tag }}"
body_path: changelog.md
files: |
dist/*.tar.gz
dist/*.zip
dist/checksums.txt
dist/checksums.txt
install.sh

13
cmd/claudia-docs/main.go Normal file
View File

@@ -0,0 +1,13 @@
package main
import (
"os"
"github.com/claudia/docs-cli/cobra"
)
func main() {
if err := cobra.Execute(); err != nil {
os.Exit(1)
}
}