Files
gitea-mcp-extended/.gitea/workflows/release-tag.yml
Andrew Miller 1b806fc393
Some checks failed
release-nightly / publish-nightly (push) Failing after 51s
release / goreleaser (push) Successful in 1m17s
release / publish-packages (push) Failing after 33s
fix: improve package publish debugging and hardcode API URL
- Hardcode git.lethalbits.com instead of gitea.server_url variable
- Replace brace expansion with separate glob patterns for POSIX compat
- Add HTTP status code checking with response body on failure
- Add debug output for URL, actor, and file listing
2026-03-05 13:20:15 -05:00

81 lines
2.8 KiB
YAML

name: release
on:
push:
tags: ["*"]
env:
GIT_SSL_NO_VERIFY: true
GOPRIVATE: git.lethalbits.com/*
GONOSUMCHECK: git.lethalbits.com/*
GOINSECURE: git.lethalbits.com/*
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go install github.com/goreleaser/goreleaser/v2@latest
- run: goreleaser release --clean
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_FORCE_TOKEN: "gitea"
publish-packages:
runs-on: ubuntu-latest
needs: goreleaser
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build all platforms
run: |
VERSION=${GITHUB_REF_NAME#v}
TARGETS="linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64"
for target in $TARGETS; do
OS=${target%/*}
ARCH=${target#*/}
# Match goreleaser naming
case $ARCH in amd64) UARCH=x86_64;; arm64) UARCH=arm64;; esac
case $OS in linux) UOS=Linux;; darwin) UOS=Darwin;; windows) UOS=Windows;; esac
EXT=tar.gz; [ "$OS" = "windows" ] && EXT=zip
OUTDIR="dist/gitea-mcp-extended_${UOS}_${UARCH}"
mkdir -p "$OUTDIR"
CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH \
go build -trimpath -ldflags "-s -w -X main.Version=$VERSION" \
-o "$OUTDIR/gitea-mcp-extended$([ $OS = windows ] && echo .exe)"
ARCHIVE="gitea-mcp-extended_${UOS}_${UARCH}.${EXT}"
if [ "$EXT" = "zip" ]; then
(cd "$OUTDIR" && zip -r "../../$ARCHIVE" .)
else
tar czf "$ARCHIVE" -C "$OUTDIR" .
fi
done
- name: Publish to Generic Package Registry
run: |
VERSION=${GITHUB_REF_NAME#v}
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/${VERSION}"
echo "Publishing to: $API_BASE"
ls -la gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip 2>/dev/null || true
for f in gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip; do
[ -f "$f" ] || continue
echo "Uploading $f..."
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
--user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
--upload-file "$f" \
"${API_BASE}/${f}")
echo "HTTP response: $HTTP_CODE"
if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then
echo "Upload failed! Response body:"
cat /tmp/upload_response
exit 1
fi
echo "Uploaded $f successfully"
done