-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (104 loc) · 3.39 KB
/
release-draft.yml
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
name: Build executable and Create draft release
# Build and release the simple_ytdl executable when a tag is pushed
# Executables will be built according to the values of the BUILD_WINDOWS, BUILD_LINUX, and BUILD_MACOS repository variables
# Set repo variable values in Settings > Secrets and variables > Actions > Variables > Repository variables
on:
push:
tags:
- v*
jobs:
# region Build Win exe
build-windows:
if: ${{ vars.BUILD_WINDOWS == 'true' }}
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python Packages
run: python scripts/install_reqs.py
- name: Build simple_ytdl.exe
run: python scripts/build.py -cs
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: simple_ytdl_windows
path: ./pyinstaller
# region Build Linux exe
build-linux:
if: ${{ vars.BUILD_LINUX == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python Packages
run: python scripts/install_reqs.py
- name: Build simple_ytdl
run: python scripts/build.py -cs
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: simple_ytdl_linux
path: ./pyinstaller
# region Build MacOS exe
build-macos:
if: ${{ vars.BUILD_MACOS == 'true' }}
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python Packages
run: python scripts/install_reqs.py
- name: Build simple_ytdl
run: python scripts/build.py -cs
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: simple_ytdl_macos
path: ./pyinstaller
# region Create a draft release
release:
# Wait for all build jobs to complete, as long as none of them failed then we will create the draft release
needs: [build-windows, build-linux, build-macos]
if: ${{ !failure() }}
runs-on: ubuntu-latest
steps:
- name: Download Windows executable
if: ${{ vars.BUILD_WINDOWS == 'true' }}
uses: actions/download-artifact@v4
with:
name: simple_ytdl_windows
- name: Download Linux executable
if: ${{ vars.BUILD_LINUX == 'true' }}
uses: actions/download-artifact@v4
with:
name: simple_ytdl_linux
- name: Download MacOS executable
if: ${{ vars.BUILD_MACOS == 'true' }}
uses: actions/download-artifact@v4
with:
name: simple_ytdl_macos
- name: Create a draft release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: true
prerelease: false
files: |
${{ vars.BUILD_WINDOWS == 'true' && 'dist/simple_ytdl_win32.exe' || '' }}
${{ vars.BUILD_LINUX == 'true' && 'dist/simple_ytdl_linux' || '' }}
${{ vars.BUILD_MACOS == 'true' && 'dist/simple_ytdl_macos' || '' }}