mirror of
https://github.com/BillyOutlast/rocm-automated.git
synced 2026-02-04 03:51:19 +01:00
291 lines
10 KiB
YAML
291 lines
10 KiB
YAML
name: Release Build (Gitea)
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Release version (e.g., v1.0.0)'
|
|
required: true
|
|
type: string
|
|
create_release:
|
|
description: 'Create Gitea release'
|
|
required: true
|
|
default: true
|
|
type: boolean
|
|
|
|
env:
|
|
REGISTRY: docker.io
|
|
REGISTRY_USER: getterup
|
|
|
|
jobs:
|
|
validate-release:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Validate and extract version
|
|
id: version
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
VERSION="${{ github.event.inputs.version }}"
|
|
else
|
|
VERSION="${{ github.ref_name }}"
|
|
fi
|
|
|
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
|
|
# Check if this is a pre-release (contains alpha, beta, rc)
|
|
if [[ "$VERSION" =~ (alpha|beta|rc) ]]; then
|
|
echo "is_prerelease=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "is_prerelease=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
echo "📋 Release version: $VERSION"
|
|
echo "🚀 Pre-release: $([ \"${{ steps.version.outputs.is_prerelease }}\" == \"true\" ] && echo \"Yes\" || echo \"No\")"
|
|
shell: bash
|
|
|
|
build-release-images:
|
|
runs-on: ubuntu-latest
|
|
needs: validate-release
|
|
strategy:
|
|
matrix:
|
|
image:
|
|
- name: comfyui-rocm7.1
|
|
dockerfile: Dockerfile.comfyui-rocm7.1
|
|
- name: stable-diffusion.cpp-rocm7.1
|
|
dockerfile: Dockerfile.stable-diffusion.cpp-rocm7.1
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: https://gitea.com/actions/setup-docker@v1
|
|
with:
|
|
buildx: true
|
|
|
|
- name: Log in to Docker Hub
|
|
run: |
|
|
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u ${{ env.REGISTRY_USER }} --password-stdin
|
|
shell: bash
|
|
|
|
- name: Build and push release image
|
|
run: |
|
|
IMAGE_NAME="${{ env.REGISTRY }}/${{ env.REGISTRY_USER }}/${{ matrix.image.name }}"
|
|
VERSION="${{ needs.validate-release.outputs.version }}"
|
|
|
|
# Create tags
|
|
TAGS="${IMAGE_NAME}:${VERSION}"
|
|
|
|
# Add latest tag for main releases (not pre-releases)
|
|
if [[ "${{ needs.validate-release.outputs.is_prerelease }}" != "true" ]]; then
|
|
TAGS="${TAGS} ${IMAGE_NAME}:latest"
|
|
fi
|
|
|
|
# Add semantic version tags for releases
|
|
if [[ "$VERSION" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
|
|
MAJOR="${BASH_REMATCH[1]}"
|
|
MINOR="${BASH_REMATCH[2]}"
|
|
PATCH="${BASH_REMATCH[3]}"
|
|
|
|
TAGS="${TAGS} ${IMAGE_NAME}:${MAJOR}.${MINOR}.${PATCH}"
|
|
TAGS="${TAGS} ${IMAGE_NAME}:${MAJOR}.${MINOR}"
|
|
|
|
# Only add major version tag for stable releases
|
|
if [[ "${{ needs.validate-release.outputs.is_prerelease }}" != "true" ]]; then
|
|
TAGS="${TAGS} ${IMAGE_NAME}:${MAJOR}"
|
|
fi
|
|
fi
|
|
|
|
echo "🏷️ Building with tags: $TAGS"
|
|
|
|
# Build and push the image
|
|
docker buildx build \
|
|
--context . \
|
|
--file Dockerfiles/${{ matrix.image.dockerfile }} \
|
|
--platform linux/amd64 \
|
|
--build-arg VERSION=$VERSION \
|
|
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
|
--build-arg VCS_REF=${{ github.sha }} \
|
|
$(for tag in $TAGS; do echo "--tag $tag"; done) \
|
|
--push \
|
|
.
|
|
shell: bash
|
|
|
|
build-gpu-variants:
|
|
runs-on: ubuntu-latest
|
|
needs: validate-release
|
|
strategy:
|
|
matrix:
|
|
gfx_arch: [gfx1150, gfx1151, gfx1200, gfx1100, gfx1101, gfx1030, gfx1201]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: https://gitea.com/actions/setup-docker@v1
|
|
with:
|
|
buildx: true
|
|
|
|
- name: Log in to Docker Hub
|
|
run: |
|
|
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u ${{ env.REGISTRY_USER }} --password-stdin
|
|
shell: bash
|
|
|
|
- name: Build and push GPU variant
|
|
run: |
|
|
IMAGE_NAME="${{ env.REGISTRY }}/${{ env.REGISTRY_USER }}/stable-diffusion-cpp-${{ matrix.gfx_arch }}"
|
|
VERSION="${{ needs.validate-release.outputs.version }}"
|
|
|
|
# Create tags
|
|
TAGS="${IMAGE_NAME}:${VERSION}"
|
|
|
|
# Add latest tag for main releases (not pre-releases)
|
|
if [[ "${{ needs.validate-release.outputs.is_prerelease }}" != "true" ]]; then
|
|
TAGS="${TAGS} ${IMAGE_NAME}:latest"
|
|
fi
|
|
|
|
# Add semantic version tags
|
|
if [[ "$VERSION" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
|
|
MAJOR="${BASH_REMATCH[1]}"
|
|
MINOR="${BASH_REMATCH[2]}"
|
|
PATCH="${BASH_REMATCH[3]}"
|
|
|
|
TAGS="${TAGS} ${IMAGE_NAME}:${MAJOR}.${MINOR}.${PATCH}"
|
|
TAGS="${TAGS} ${IMAGE_NAME}:${MAJOR}.${MINOR}"
|
|
fi
|
|
|
|
echo "🏷️ Building ${{ matrix.gfx_arch }} variant with tags: $TAGS"
|
|
|
|
# Build and push the GPU-specific image
|
|
docker buildx build \
|
|
--context . \
|
|
--file Dockerfiles/Dockerfile.stable-diffusion.cpp-rocm7.1 \
|
|
--platform linux/amd64 \
|
|
--build-arg GFX_ARCH=${{ matrix.gfx_arch }} \
|
|
--build-arg VERSION=$VERSION \
|
|
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
|
--build-arg VCS_REF=${{ github.sha }} \
|
|
$(for tag in $TAGS; do echo "--tag $tag"; done) \
|
|
--push \
|
|
.
|
|
shell: bash
|
|
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
needs: [validate-release, build-release-images, build-gpu-variants]
|
|
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Generate release notes
|
|
id: release_notes
|
|
run: |
|
|
VERSION="${{ needs.validate-release.outputs.version }}"
|
|
|
|
cat > release_notes.md << EOF
|
|
## 🚀 ROCm 7.1 Container Release ${VERSION}
|
|
|
|
### 📦 Container Images Built
|
|
|
|
**Base Images:**
|
|
- \`${{ env.REGISTRY_USER }}/comfyui-rocm7.1:${VERSION}\`
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion.cpp-rocm7.1:${VERSION}\`
|
|
|
|
**GPU-Specific Variants:**
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1150:${VERSION}\` (RDNA 3.5 - Ryzen AI 9 HX 370)
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1151:${VERSION}\` (RDNA 3.5 - Strix Point)
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1200:${VERSION}\` (RDNA 4 - RX 9070 XT)
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1100:${VERSION}\` (RDNA 3 - RX 7900 XTX/XT)
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1101:${VERSION}\` (RDNA 3 - RX 7800/7700 XT)
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1030:${VERSION}\` (RDNA 2 - RX 6000 series)
|
|
- \`${{ env.REGISTRY_USER }}/stable-diffusion-cpp-gfx1201:${VERSION}\` (RDNA 4 - RX 9060/9070 XT)
|
|
|
|
### 🔧 Quick Start
|
|
|
|
\`\`\`bash
|
|
# Clone the repository
|
|
git clone <your-gitea-repo-url>
|
|
cd rocm-automated
|
|
|
|
# Start the services
|
|
docker-compose up -d
|
|
|
|
# Access Open WebUI
|
|
open http://localhost:3000
|
|
\`\`\`
|
|
|
|
### 🛠️ What's New in This Release
|
|
|
|
- ROCm 7.1 support for AMD GPUs
|
|
- Optimized ComfyUI for AI image generation
|
|
- Stable Diffusion.cpp with GPU acceleration
|
|
- Multi-GPU architecture support
|
|
- Docker Compose configuration for easy deployment
|
|
- Automated daily builds and security scanning
|
|
|
|
### 📋 System Requirements
|
|
|
|
- **AMD GPU**: RDNA 2/3/4 architecture (RX 6000/7000/9000 series)
|
|
- **Memory**: 16GB+ system RAM recommended
|
|
- **VRAM**: 8GB+ GPU memory for large models
|
|
- **OS**: Linux with Docker 24.0+ and Docker Compose 2.20+
|
|
|
|
### 📖 Documentation
|
|
|
|
- [Setup Guide](README.md)
|
|
- [ComfyUI Setup](OPEN_WEBUI_COMFYUI_SETUP.md)
|
|
- [GitHub Actions](/.github/workflows/README.md)
|
|
|
|
### 🐛 Issues & Support
|
|
|
|
Please report issues and ask questions in the repository's issue tracker.
|
|
|
|
---
|
|
|
|
**Build Information:**
|
|
- Build Date: $(date -u +'%Y-%m-%d %H:%M:%S UTC')
|
|
- Commit SHA: \`$(echo ${{ github.sha }} | cut -c1-7)\`
|
|
- Built with Gitea Actions
|
|
EOF
|
|
|
|
echo "📝 Release notes generated for ${VERSION}"
|
|
shell: bash
|
|
|
|
- name: Create Gitea Release
|
|
run: |
|
|
VERSION="${{ needs.validate-release.outputs.version }}"
|
|
IS_PRERELEASE="${{ needs.validate-release.outputs.is_prerelease }}"
|
|
|
|
echo "🚀 Creating Gitea release for ${VERSION}"
|
|
|
|
# Note: This is a placeholder - actual Gitea API calls would depend on your Gitea instance
|
|
# You would typically use curl with the Gitea API or a Gitea CLI tool
|
|
|
|
echo "📋 Release Summary:"
|
|
echo "- Version: ${VERSION}"
|
|
echo "- Pre-release: ${IS_PRERELEASE}"
|
|
echo "- Commit: ${{ github.sha }}"
|
|
echo "- Built images: 9 total (2 base + 7 GPU variants)"
|
|
|
|
# Example of what a Gitea API call might look like:
|
|
# curl -X POST "https://your-gitea.com/api/v1/repos/owner/repo/releases" \
|
|
# -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
# -H "Content-Type: application/json" \
|
|
# -d @release_payload.json
|
|
|
|
echo "✅ Release process completed"
|
|
echo "🐳 Docker images available at: ${{ env.REGISTRY }}/${{ env.REGISTRY_USER }}/"
|
|
shell: bash |