Skip to content

Commit 851124a

Browse files
authored
Merge pull request #434 from arabcoders/dev
Prepare for v1.0 release.
2 parents 1103b93 + ffeaefa commit 851124a

File tree

25 files changed

+554
-116
lines changed

25 files changed

+554
-116
lines changed

.github/workflows/build-pr.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v4
2626

27-
# Python setup and testing
2827
- name: Set up Python
2928
uses: actions/setup-python@v5
3029
with:
3130
python-version: ${{ env.PYTHON_VERSION }}
3231

3332
- name: Install uv
34-
uses: astral-sh/setup-uv@v4
35-
with:
36-
version: "latest"
33+
run: pip install uv
3734

3835
- name: Install Python dependencies
3936
run: uv sync
@@ -44,7 +41,6 @@ jobs:
4441
- name: Run Python tests
4542
run: uv run pytest app/tests/ -v --tb=short
4643

47-
# Frontend setup and testing
4844
- name: Install pnpm
4945
uses: pnpm/action-setup@v4
5046
with:
@@ -85,7 +81,6 @@ jobs:
8581
working-directory: ui
8682
run: pnpm run generate
8783

88-
# Quick Docker build validation (no push, cache only)
8984
- name: Set up Docker Buildx
9085
uses: docker/setup-buildx-action@v3
9186

.github/workflows/main.yml

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
- ".github/ISSUE_TEMPLATE/**"
2323

2424
env:
25+
REGISTRY: ${{ vars.REGISTRY != '' && vars.REGISTRY || '' }}
2526
DOCKERHUB_SLUG: arabcoders/ytptube
2627
GHCR_SLUG: ghcr.io/arabcoders/ytptube
2728
PNPM_VERSION: 10
@@ -40,18 +41,13 @@ jobs:
4041
with:
4142
fetch-depth: 0
4243

43-
# Python setup and testing
4444
- name: Set up Python
4545
uses: actions/setup-python@v5
4646
with:
4747
python-version: ${{ env.PYTHON_VERSION }}
4848

4949
- name: Install uv
50-
uses: astral-sh/setup-uv@v6.7
51-
with:
52-
enable-cache: true
53-
save-cache: true
54-
version: "latest"
50+
run: pip install uv
5551

5652
- name: Install Python dependencies
5753
run: uv sync
@@ -62,7 +58,6 @@ jobs:
6258
- name: Run Python tests
6359
run: uv run pytest app/tests/ -v --tb=short
6460

65-
# Frontend setup and testing
6661
- name: Install pnpm
6762
uses: pnpm/action-setup@v4
6863
with:
@@ -118,6 +113,7 @@ jobs:
118113
119114
- name: Upload frontend build
120115
uses: actions/upload-artifact@v4
116+
if: env.REGISTRY == ''
121117
with:
122118
name: frontend-build
123119
path: ui/exported/
@@ -147,6 +143,7 @@ jobs:
147143

148144
- name: Download frontend build
149145
uses: actions/download-artifact@v4
146+
if: env.REGISTRY == ''
150147
with:
151148
name: frontend-build
152149
path: ui/exported/
@@ -178,8 +175,9 @@ jobs:
178175
uses: docker/metadata-action@v5
179176
with:
180177
images: |
181-
${{ env.DOCKERHUB_SLUG }}
182-
${{ env.GHCR_SLUG }}
178+
name=${{ env.DOCKERHUB_SLUG }},enable=${{ env.REGISTRY == '' }}
179+
name=${{ env.GHCR_SLUG }},enable=${{ env.REGISTRY == '' }}
180+
name=${{ env.REGISTRY }}/${{ github.repository }},enable=${{ env.REGISTRY != '' }}
183181
flavor: |
184182
latest=false
185183
suffix=-${{ env.ARCH }}
@@ -188,15 +186,25 @@ jobs:
188186
type=ref,event=tag
189187
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
190188
189+
- name: Login to Private Registry
190+
uses: docker/login-action@v3
191+
if: env.REGISTRY != ''
192+
with:
193+
registry: ${{ env.REGISTRY }}
194+
username: ${{ github.actor }}
195+
password: ${{ secrets.GIT_TOKEN && secrets.GIT_TOKEN || secrets.GITHUB_TOKEN }}
196+
191197
- name: Login to GitHub Container Registry
192198
uses: docker/login-action@v3
199+
if: env.REGISTRY == ''
193200
with:
194201
registry: ghcr.io
195202
username: ${{ github.actor }}
196203
password: ${{ secrets.GITHUB_TOKEN }}
197204

198205
- name: Login to DockerHub
199206
uses: docker/login-action@v3
207+
if: env.REGISTRY == ''
200208
with:
201209
username: ${{ secrets.DOCKERHUB_USERNAME }}
202210
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -212,13 +220,9 @@ jobs:
212220
push: true
213221
tags: ${{ steps.meta.outputs.tags }}
214222
labels: ${{ steps.meta.outputs.labels }}
215-
cache-from: |
216-
type=gha,scope=${{ github.workflow }}
217-
type=registry,ref=ghcr.io/arabcoders/ytptube:buildcache
218-
cache-to: |
219-
type=gha,mode=max,scope=${{ github.workflow }}
220-
type=registry,ref=ghcr.io/arabcoders/ytptube:buildcache,mode=max
221-
provenance: false
223+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
224+
cache-from: type=gha,scope=${{ github.workflow }}
225+
provenance: true
222226

223227
docker-publish-manifest:
224228
name: Publish multi-arch manifest
@@ -233,24 +237,35 @@ jobs:
233237
uses: docker/metadata-action@v5
234238
with:
235239
images: |
236-
${{ env.DOCKERHUB_SLUG }}
237-
${{ env.GHCR_SLUG }}
240+
name=${{ env.DOCKERHUB_SLUG }},enable=${{ env.REGISTRY == '' }}
241+
name=${{ env.GHCR_SLUG }},enable=${{ env.REGISTRY == '' }}
242+
name=${{ env.REGISTRY }}/${{ github.repository }},enable=${{ env.REGISTRY != '' }}
238243
flavor: |
239244
latest=false
240245
tags: |
241246
type=ref,event=branch
242247
type=ref,event=tag
243248
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
244249
250+
- name: Login to Private Registry
251+
uses: docker/login-action@v3
252+
if: env.REGISTRY != ''
253+
with:
254+
registry: ${{ env.REGISTRY }}
255+
username: ${{ github.actor }}
256+
password: ${{ secrets.GIT_TOKEN && secrets.GIT_TOKEN || secrets.GITHUB_TOKEN }}
257+
245258
- name: Login to GitHub Container Registry
246259
uses: docker/login-action@v3
260+
if: env.REGISTRY == ''
247261
with:
248262
registry: ghcr.io
249263
username: ${{ github.actor }}
250264
password: ${{ secrets.GITHUB_TOKEN }}
251265

252266
- name: Login to DockerHub
253267
uses: docker/login-action@v3
268+
if: env.REGISTRY == ''
254269
with:
255270
username: ${{ secrets.DOCKERHUB_USERNAME }}
256271
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -268,7 +283,7 @@ jobs:
268283
done
269284
270285
- name: Overwrite GitHub release notes
271-
if: startsWith(github.ref, 'refs/tags/v')
286+
if: startsWith(github.ref, 'refs/tags/v') && env.REGISTRY == ''
272287
uses: actions/github-script@v6
273288
with:
274289
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -322,6 +337,7 @@ jobs:
322337
steps:
323338
- name: Sync README
324339
uses: docker://lsiodev/readme-sync:latest
340+
if: env.REGISTRY == ''
325341
env:
326342
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
327343
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/native-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616

1717
jobs:
1818
build:
19+
if: ${{ vars.REGISTRY == '' }}
1920
runs-on: ${{ matrix.os }}
2021
strategy:
2122
matrix:

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"Funsafe",
7878
"getpid",
7979
"gibibytes",
80+
"gitea",
8081
"gitpython",
8182
"gpac",
8283
"hiddenimports",

0 commit comments

Comments
 (0)