Skip to content

Commit 604b66b

Browse files
committed
feat: separate builds by tag prefix (server-v*, app-v*, v*)
1 parent a342187 commit 604b66b

3 files changed

Lines changed: 105 additions & 16 deletions

File tree

.github/workflows/buildrelease.yml

Lines changed: 88 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
11
name: Build and Release
22

3+
# Triggers:
4+
# - Release published with tags:
5+
# - server-v* : Build only Server
6+
# - app-v* : Build only TFMAudioApp (Android, Windows, macOS)
7+
# - v* : Build everything
8+
# - Manual workflow dispatch with checkboxes
9+
310
on:
411
release:
512
types: [published]
13+
workflow_dispatch:
14+
inputs:
15+
build_server:
16+
description: 'Build Server'
17+
type: boolean
18+
default: false
19+
build_android:
20+
description: 'Build Android App'
21+
type: boolean
22+
default: false
23+
build_windows:
24+
description: 'Build Windows App'
25+
type: boolean
26+
default: false
27+
build_macos:
28+
description: 'Build macOS App'
29+
type: boolean
30+
default: false
31+
version:
32+
description: 'Version (e.g., 1.0.0)'
33+
type: string
34+
required: false
35+
default: '0.0.0-manual'
636

737
permissions:
838
contents: write
@@ -19,6 +49,10 @@ jobs:
1949
build-server:
2050
name: Build Server
2151
runs-on: ubuntu-latest
52+
# Run if: manual with build_server OR release with server-v* or v* (but not app-v*)
53+
if: |
54+
(github.event_name == 'workflow_dispatch' && inputs.build_server) ||
55+
(github.event_name == 'release' && (startsWith(github.event.release.tag_name, 'server-v') || (startsWith(github.event.release.tag_name, 'v') && !startsWith(github.event.release.tag_name, 'app-v'))))
2256
steps:
2357
- name: '📄 Checkout'
2458
uses: actions/checkout@v4
@@ -38,8 +72,15 @@ jobs:
3872
- name: '📦 Extract version'
3973
id: version
4074
run: |
41-
TAG=${{ github.event.release.tag_name }}
42-
VERSION=${TAG#v}
75+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
76+
VERSION="${{ inputs.version }}"
77+
TAG="v${VERSION}"
78+
else
79+
TAG=${{ github.event.release.tag_name }}
80+
# Remove server-v or v prefix
81+
VERSION=${TAG#server-v}
82+
VERSION=${VERSION#v}
83+
fi
4384
echo "version=$VERSION" >> $GITHUB_OUTPUT
4485
echo "tag=$TAG" >> $GITHUB_OUTPUT
4586
@@ -85,6 +126,10 @@ jobs:
85126
build-android:
86127
name: Build Android APK
87128
runs-on: ubuntu-latest
129+
# Run if: manual with build_android OR release with app-v* or v* (but not server-v*)
130+
if: |
131+
(github.event_name == 'workflow_dispatch' && inputs.build_android) ||
132+
(github.event_name == 'release' && (startsWith(github.event.release.tag_name, 'app-v') || (startsWith(github.event.release.tag_name, 'v') && !startsWith(github.event.release.tag_name, 'server-v'))))
88133
steps:
89134
- name: '📄 Checkout'
90135
uses: actions/checkout@v4
@@ -109,8 +154,15 @@ jobs:
109154
- name: '📦 Extract version'
110155
id: version
111156
run: |
112-
TAG=${{ github.event.release.tag_name }}
113-
VERSION=${TAG#v}
157+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
158+
VERSION="${{ inputs.version }}"
159+
TAG="v${VERSION}"
160+
else
161+
TAG=${{ github.event.release.tag_name }}
162+
# Remove app-v or v prefix
163+
VERSION=${TAG#app-v}
164+
VERSION=${VERSION#v}
165+
fi
114166
# Extract version number for Android (must be integer)
115167
VERSION_CODE=$(echo $VERSION | sed 's/\.//g' | sed 's/[^0-9]//g')
116168
# If empty or starts with 0, use date-based version
@@ -195,6 +247,10 @@ jobs:
195247
build-windows:
196248
name: Build Windows App
197249
runs-on: windows-2022
250+
# Run if: manual with build_windows OR release with app-v* or v* (but not server-v*)
251+
if: |
252+
(github.event_name == 'workflow_dispatch' && inputs.build_windows) ||
253+
(github.event_name == 'release' && (startsWith(github.event.release.tag_name, 'app-v') || (startsWith(github.event.release.tag_name, 'v') && !startsWith(github.event.release.tag_name, 'server-v'))))
198254
steps:
199255
- name: '📄 Checkout'
200256
uses: actions/checkout@v4
@@ -220,8 +276,15 @@ jobs:
220276
id: version
221277
shell: bash
222278
run: |
223-
TAG=${{ github.event.release.tag_name }}
224-
VERSION=${TAG#v}
279+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
280+
VERSION="${{ inputs.version }}"
281+
TAG="v${VERSION}"
282+
else
283+
TAG=${{ github.event.release.tag_name }}
284+
# Remove app-v or v prefix
285+
VERSION=${TAG#app-v}
286+
VERSION=${VERSION#v}
287+
fi
225288
echo "version=$VERSION" >> $GITHUB_OUTPUT
226289
echo "tag=$TAG" >> $GITHUB_OUTPUT
227290
@@ -239,6 +302,7 @@ jobs:
239302
-o bin/windows-app
240303
241304
- name: '🔐 Sign Windows App (if certificate available)'
305+
continue-on-error: true
242306
shell: pwsh
243307
env:
244308
WINDOWS_CERT_BASE64: ${{ secrets.WINDOWS_CERT_BASE64 }}
@@ -300,6 +364,10 @@ jobs:
300364
build-macos:
301365
name: Build macOS App
302366
runs-on: macos-15
367+
# Run if: manual with build_macos OR release with app-v* or v* (but not server-v*)
368+
if: |
369+
(github.event_name == 'workflow_dispatch' && inputs.build_macos) ||
370+
(github.event_name == 'release' && (startsWith(github.event.release.tag_name, 'app-v') || (startsWith(github.event.release.tag_name, 'v') && !startsWith(github.event.release.tag_name, 'server-v'))))
303371
steps:
304372
- name: '📄 Checkout'
305373
uses: actions/checkout@v4
@@ -343,8 +411,15 @@ jobs:
343411
- name: '📦 Extract version'
344412
id: version
345413
run: |
346-
TAG=${{ github.event.release.tag_name }}
347-
VERSION=${TAG#v}
414+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
415+
VERSION="${{ inputs.version }}"
416+
TAG="v${VERSION}"
417+
else
418+
TAG=${{ github.event.release.tag_name }}
419+
# Remove app-v or v prefix
420+
VERSION=${TAG#app-v}
421+
VERSION=${VERSION#v}
422+
fi
348423
echo "version=$VERSION" >> $GITHUB_OUTPUT
349424
echo "tag=$TAG" >> $GITHUB_OUTPUT
350425
@@ -412,7 +487,11 @@ jobs:
412487
upload-release:
413488
name: Upload to Release
414489
needs: [build-server, build-android, build-windows, build-macos]
415-
if: always() && needs.build-server.result == 'success'
490+
# Run if release event AND at least one build succeeded (not skipped)
491+
if: |
492+
always() &&
493+
github.event_name == 'release' &&
494+
(needs.build-server.result == 'success' || needs.build-android.result == 'success' || needs.build-windows.result == 'success' || needs.build-macos.result == 'success')
416495
runs-on: ubuntu-latest
417496
steps:
418497
- name: '📊 Build Status Summary'

.github/workflows/release-docker-image.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
name: Docker Image CI (Release)
22

3+
# Triggers:
4+
# - Push tags: server-v* OR v* (but NOT app-v*)
5+
# Docker is only built for Server releases
6+
37
on:
48
push:
5-
tags: [ 'v*.*.*' ]
9+
tags:
10+
- 'v*.*.*'
11+
- 'server-v*.*.*'
612

713
jobs:
814

915
build:
10-
1116
runs-on: ubuntu-latest
17+
# Skip if it's an app-only release
18+
if: ${{ !startsWith(github.ref_name, 'app-v') }}
1219

1320
steps:
1421
- uses: actions/checkout@v4
1522

1623
- name: Extract version from tag
1724
id: version
1825
run: |
19-
# Remove 'v' prefix from tag (v1.2.3 -> 1.2.3)
20-
VERSION=${GITHUB_REF_NAME#v}
26+
TAG=${GITHUB_REF_NAME}
27+
# Remove 'server-v' or 'v' prefix
28+
VERSION=${TAG#server-v}
29+
VERSION=${VERSION#v}
2130
echo "version=$VERSION" >> $GITHUB_OUTPUT
22-
echo "Extracted version: $VERSION"
31+
echo "tag=$TAG" >> $GITHUB_OUTPUT
32+
echo "Extracted version: $VERSION from tag: $TAG"
2333
2434
- name: 'Login to GitHub Container Registry'
2535
uses: docker/login-action@v3

TFMAudioApp/Services/AudioPlayerService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class AudioPlayerService : IAudioPlayerService, IDisposable
1717
private readonly Random _random = new();
1818

1919
private LibVLC? _libVLC;
20-
private MediaPlayer? _mediaPlayer;
20+
private LibVLCSharp.Shared.MediaPlayer? _mediaPlayer;
2121
private Media? _currentMedia;
2222
private System.Timers.Timer? _positionTimer;
2323
private List<Track> _originalQueue = new();
@@ -105,7 +105,7 @@ public void Initialize()
105105
};
106106

107107
// Create media player
108-
_mediaPlayer = new MediaPlayer(_libVLC);
108+
_mediaPlayer = new LibVLCSharp.Shared.MediaPlayer(_libVLC);
109109
_mediaPlayer.Volume = (int)(_volume * 100);
110110

111111
// Setup event handlers

0 commit comments

Comments
 (0)