4b3cac66c3
- install.sh: verify SHA-256 checksum before installing binary - install.sh: fallback to ~/.local/bin if /usr/local/bin not writable - install.sh: use sed instead of grep for POSIX-safe JSON parsing - release.yml: remove jq dependency, parse release ID with sed - llm: make temperature configurable via --llm-temperature / LLM_TEMPERATURE - llm: add WithTemperature builder method on Client - llm: omit temperature from request when zero (uses server default)
70 lines
2.4 KiB
YAML
70 lines
2.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26'
|
|
|
|
- name: Run tests
|
|
run: go test ./...
|
|
|
|
- name: Build binaries
|
|
run: |
|
|
VERSION=${GITHUB_REF_NAME}
|
|
mkdir -p dist
|
|
|
|
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${VERSION}" -o dist/review-bot-linux-amd64 ./cmd/review-bot
|
|
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X main.version=${VERSION}" -o dist/review-bot-linux-arm64 ./cmd/review-bot
|
|
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=${VERSION}" -o dist/review-bot-darwin-amd64 ./cmd/review-bot
|
|
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.version=${VERSION}" -o dist/review-bot-darwin-arm64 ./cmd/review-bot
|
|
|
|
cd dist && sha256sum * > checksums.txt
|
|
|
|
- name: Create release and upload assets
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
run: |
|
|
VERSION=${GITHUB_REF_NAME}
|
|
GITEA_URL="${{ github.server_url }}"
|
|
REPO="${{ github.repository }}"
|
|
|
|
# Create release (parse ID without jq using grep/sed)
|
|
RESPONSE=$(curl -sSf -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
"${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
|
-d "{\"tag_name\": \"${VERSION}\", \"name\": \"${VERSION}\", \"body\": \"Release ${VERSION}\", \"draft\": false, \"prerelease\": false}")
|
|
|
|
RELEASE_ID=$(echo "$RESPONSE" | sed -n 's/.*"id":\([0-9]*\).*/\1/p' | head -1)
|
|
|
|
if [ -z "$RELEASE_ID" ]; then
|
|
echo "Failed to create release" >&2
|
|
echo "$RESPONSE" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Created release ID: ${RELEASE_ID}"
|
|
|
|
# Upload each asset
|
|
for file in dist/*; do
|
|
filename=$(basename "$file")
|
|
echo "Uploading ${filename}..."
|
|
curl -sSf -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/octet-stream" \
|
|
"${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${filename}" \
|
|
--data-binary "@${file}"
|
|
done
|
|
|
|
echo "Release ${VERSION} created with assets"
|