Merge remote-tracking branch 'origin/main' into breaking/ytdlp-execution #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/dist/simple_ytdl_win32.exe | |
# 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/dist/simple_ytdl_linux | |
# 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/dist/simple_ytdl_macos | |
# region Create a draft release | |
release: | |
needs: [build-windows, build-linux, build-macos] | |
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' && 'simple_ytdl_win32.exe' || '' }} | |
${{ vars.BUILD_LINUX == 'true' && 'simple_ytdl_linux' || '' }} | |
${{ vars.BUILD_MACOS == 'true' && 'simple_ytdl_macos' || '' }} |