Skip to content

Commit 8156b29

Browse files
authored
Merge pull request #104 from remsky/v0.1.4
V0.1.4 - CI updates
2 parents 83905e1 + c4b5185 commit 8156b29

File tree

3 files changed

+18
-125
lines changed

3 files changed

+18
-125
lines changed

.github/workflows/docker-publish.yml

Lines changed: 16 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,44 @@
1-
name: Docker Build, Slim, and Publish
1+
name: Docker Build and Publish
22

33
on:
44
push:
5-
branches:
6-
- master
75
tags: [ 'v*.*.*' ]
8-
# Allow manual trigger from GitHub UI
96
workflow_dispatch:
107

11-
env:
12-
REGISTRY: ghcr.io
13-
IMAGE_NAME: ${{ github.repository }}
14-
158
jobs:
169
build:
1710
runs-on: ubuntu-latest
1811
permissions:
19-
contents: read
12+
contents: write
2013
packages: write
21-
actions: write
22-
2314
steps:
2415
- name: Checkout repository
2516
uses: actions/checkout@v4
2617

27-
- name: Log in to the Container registry
28-
uses: docker/login-action@v3
29-
with:
30-
registry: ${{ env.REGISTRY }}
31-
username: ${{ github.actor }}
32-
password: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
3320

34-
# Set up image names (converting to lowercase)
35-
- name: Set image names
36-
run: |
37-
echo "GPU_IMAGE_NAME=${{ env.REGISTRY }}/$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]')-gpu" >> $GITHUB_ENV
38-
echo "CPU_IMAGE_NAME=${{ env.REGISTRY }}/$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]')-cpu" >> $GITHUB_ENV
39-
echo "UI_IMAGE_NAME=${{ env.REGISTRY }}/$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]')-ui" >> $GITHUB_ENV
40-
41-
# Build GPU version
42-
- name: Build GPU Docker image
43-
uses: docker/build-push-action@v5
44-
with:
45-
context: .
46-
file: ./docker/gpu/Dockerfile
47-
push: false
48-
load: true
49-
tags: ${{ env.GPU_IMAGE_NAME }}:v0.1.0
50-
build-args: |
51-
DOCKER_BUILDKIT=1
52-
platforms: linux/amd64
53-
54-
# Slim GPU version
55-
- name: Slim GPU Docker image
56-
run: |
57-
docker pull dslim/slim
58-
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/slim build \
59-
--target ${{ env.GPU_IMAGE_NAME }}:v0.1.0 \
60-
--tag ${{ env.GPU_IMAGE_NAME }}:v0.1.0-slim \
61-
--include-path=/app/models \
62-
--include-path=/app/api/src/voices \
63-
--include-path=/app/.venv \
64-
--include-bin=/usr/local/cuda/lib64 \
65-
--include-bin=/usr/lib/x86_64-linux-gnu/libcudart.so \
66-
--include-bin=/usr/lib/x86_64-linux-gnu/libcuda.so \
67-
--include-shell \
68-
--include-exe=python3,python3.10,espeak-ng \
69-
--exclude-mounts=false \
70-
--http-probe=false
71-
72-
# Push GPU versions
73-
- name: Push GPU Docker images
74-
run: |
75-
docker push ${{ env.GPU_IMAGE_NAME }}:v0.1.0
76-
docker push ${{ env.GPU_IMAGE_NAME }}:v0.1.0-slim
77-
docker tag ${{ env.GPU_IMAGE_NAME }}:v0.1.0 ${{ env.GPU_IMAGE_NAME }}:latest
78-
docker tag ${{ env.GPU_IMAGE_NAME }}:v0.1.0-slim ${{ env.GPU_IMAGE_NAME }}:latest-slim
79-
docker push ${{ env.GPU_IMAGE_NAME }}:latest
80-
docker push ${{ env.GPU_IMAGE_NAME }}:latest-slim
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
8123

82-
# Build CPU version
83-
- name: Build CPU Docker image
84-
uses: docker/build-push-action@v5
24+
- name: Log in to GitHub Container Registry
25+
uses: docker/login-action@v2
8526
with:
86-
context: .
87-
file: ./docker/cpu/Dockerfile
88-
push: false
89-
load: true
90-
tags: ${{ env.CPU_IMAGE_NAME }}:v0.1.0
91-
build-args: |
92-
DOCKER_BUILDKIT=1
93-
platforms: linux/amd64
94-
95-
# Slim CPU version
96-
- name: Slim CPU Docker image
97-
run: |
98-
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/slim build \
99-
--target ${{ env.CPU_IMAGE_NAME }}:v0.1.0 \
100-
--tag ${{ env.CPU_IMAGE_NAME }}:v0.1.0-slim \
101-
--include-path=/app/models \
102-
--include-path=/app/api/src/voices \
103-
--include-path=/app/.venv \
104-
--include-shell \
105-
--include-exe=python3,python3.10,espeak-ng \
106-
--exclude-mounts=false \
107-
--http-probe=false
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
10830

109-
# Push CPU versions
110-
- name: Push CPU Docker images
31+
- name: Run build script
11132
run: |
112-
docker push ${{ env.CPU_IMAGE_NAME }}:v0.1.0
113-
docker push ${{ env.CPU_IMAGE_NAME }}:v0.1.0-slim
114-
docker tag ${{ env.CPU_IMAGE_NAME }}:v0.1.0 ${{ env.CPU_IMAGE_NAME }}:latest
115-
docker tag ${{ env.CPU_IMAGE_NAME }}:v0.1.0-slim ${{ env.CPU_IMAGE_NAME }}:latest-slim
116-
docker push ${{ env.CPU_IMAGE_NAME }}:latest
117-
docker push ${{ env.CPU_IMAGE_NAME }}:latest-slim
118-
119-
# Build and push UI version
120-
- name: Build and push UI Docker image
121-
uses: docker/build-push-action@v5
122-
with:
123-
context: ./ui
124-
file: ./ui/Dockerfile
125-
push: true
126-
tags: |
127-
${{ env.UI_IMAGE_NAME }}:v0.1.0
128-
${{ env.UI_IMAGE_NAME }}:latest
129-
build-args: |
130-
DOCKER_BUILDKIT=1
131-
platforms: linux/amd64
33+
chmod +x docker/build.sh
34+
VERSION=$(cat VERSION)
35+
docker/build.sh $VERSION
13236
133-
create-release:
134-
needs: build
135-
runs-on: ubuntu-latest
136-
# Only run this job if we're pushing a tag
137-
if: startsWith(github.ref, 'refs/tags/')
138-
permissions:
139-
contents: write
140-
packages: write
141-
steps:
142-
- name: Checkout code
143-
uses: actions/checkout@v4
144-
14537
- name: Create Release
14638
uses: softprops/action-gh-release@v1
14739
env:
14840
IS_PRERELEASE: ${{ contains(github.ref, '-pre') }}
14941
with:
15042
generate_release_notes: true
151-
draft: false
43+
draft: true
15244
prerelease: ${{ contains(github.ref, '-pre') }}

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.4

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kokoro-fastapi"
3-
version = "0.1.0"
3+
version = "0.1.4"
44
description = "FastAPI TTS Service"
55
readme = "README.md"
66
requires-python = ">=3.10"

0 commit comments

Comments
 (0)