fix: simplify release workflow to goreleaser only, remove nightly/package publishing
All checks were successful
release / goreleaser (push) Successful in 1m5s
All checks were successful
release / goreleaser (push) Successful in 1m5s
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
name: release-nightly
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: true
|
||||
GOPRIVATE: git.lethalbits.com/*
|
||||
GONOSUMCHECK: git.lethalbits.com/*
|
||||
GOINSECURE: git.lethalbits.com/*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
publish-nightly:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
- name: Build all platforms
|
||||
run: |
|
||||
VERSION=$(git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
||||
TARGETS="linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64"
|
||||
for target in $TARGETS; do
|
||||
OS=${target%/*}; ARCH=${target#*/}
|
||||
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 nightly to Generic Package Registry
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.DEPLOYER_API_GITEA_API_KEY }}
|
||||
run: |
|
||||
echo "Token length: ${#GITEA_TOKEN}"
|
||||
echo "Token prefix: ${GITEA_TOKEN:0:4}..."
|
||||
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/nightly"
|
||||
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..."
|
||||
# Delete old nightly file first (can't overwrite)
|
||||
curl -k -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${API_BASE}/${f}" || true
|
||||
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
|
||||
-H "Authorization: token ${GITEA_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
|
||||
@@ -12,7 +12,6 @@ env:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
@@ -29,58 +28,3 @@ jobs:
|
||||
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
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.DEPLOYER_API_GITEA_API_KEY }}
|
||||
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}' \
|
||||
-H "Authorization: token ${GITEA_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
|
||||
|
||||
Reference in New Issue
Block a user