-
Notifications
You must be signed in to change notification settings - Fork 7
139 lines (120 loc) · 4.22 KB
/
main.yml
File metadata and controls
139 lines (120 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Build & Release Multi-Platform
on:
push:
branches:
- main
workflow_dispatch:
inputs:
tag:
description: "Tag name (e.g. v1.2.3)"
required: false
default: ""
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.asset_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Windows x64 (Runs on Win ARM64 via emulation)
- os: windows-latest
architecture: x64
asset_name: livestream_dl-windows-x64.exe
executable_name: livestream_dl.exe
use_qemu: false
- os: windows-11-arm
architecture: arm64
asset_name: livestream_dl-windows-arm64.exe
executable_name: livestream_dl.exe
use_qemu: false
# Linux x64
- os: ubuntu-latest
architecture: x64
asset_name: livestream_dl-linux-x64
executable_name: livestream_dl
use_qemu: false
# Linux ARM64
- os: ubuntu-24.04-arm
architecture: arm64
asset_name: livestream_dl-linux-arm64
executable_name: livestream_dl
use_qemu: false
steps:
- name: Checkout repo
uses: actions/checkout@v4
# --- QEMU Setup for Linux ARM64 ---
- name: Set up QEMU
if: ${{ matrix.use_qemu }}
uses: docker/setup-qemu-action@v3
# --- Python Setup ---
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
architecture: ${{ matrix.architecture == 'aarch64' && 'x64' || matrix.architecture }}
# --- Install Dependencies ---
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -U --pre "yt-dlp[default]"
pip install pyinstaller
python -c "import urllib.request; urllib.request.urlretrieve('https://raw.githubusercontent.com/yt-dlp/yt-dlp/master/devscripts/cli_to_api.py', 'cli_to_api.py')"
# --- Build Step ---
- name: Build Executable
run: |
pyinstaller --onefile --name livestream_dl --hidden-import yt_dlp_ejs runner.py
# --- Rename for Upload ---
- name: Rename Output
shell: bash
run: |
# Check if using Windows or Linux dist folder location
if [ -f "dist/${{ matrix.executable_name }}" ]; then
mv "dist/${{ matrix.executable_name }}" "dist/${{ matrix.asset_name }}"
fi
# --- Upload Artifacts (To be grabbed by Release job) ---
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.asset_name }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List Artifacts
run: ls -R artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ env.DATE }}-${{ github.run_number }}"
name: "Alpha Release - ${{ env.DATE }}"
body: |
### ⚠️ Alpha State
This release is currently in an **alpha state**.
**Dependencies Required:**
* **FFmpeg**: Must be installed and added to your system PATH.
* **Deno**: Must be installed and added to your system PATH.
**Downloads:**
| Platform | Architecture | Filename |
| :--- | :--- | :--- |
| 🪟 Windows | x64 (Intel/AMD) | `livestream_dl-windows-x64.exe` |
| 🐧 Linux | x64 (Intel/AMD) | `livestream_dl-linux-x64` |
| 🐧 Linux | arm64 (RPi/Server) | `livestream_dl-linux-arm64` |
draft: false
prerelease: true
files: artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}