Skip to content

Release

Release #26

Workflow file for this run

name: Release
on:
release:
types: [ published ]
branches:
- '*'
env:
WINDOWS_PACKAGE: m3u8downloader-${{ github.event.release.tag_name }}-windows.exe
LINUX_RPM_PACKAGE: m3u8downloader-${{ github.event.release.tag_name }}-linux.rpm
LINUX_DEB_PACKAGE: m3u8downloader-${{ github.event.release.tag_name }}-debian.deb
MACOS_PACKAGE: m3u8downloader-${{ github.event.release.tag_name }}-macos.pkg
UPLOAD_URL: ${{ github.event.release.upload_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build_windows:
name: Build (Windows)
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
os: [ windows-latest ]
python-version: [ '3.10' ]
runs-on: ${{ matrix.os }}
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build Installer
run: |
pyinstaller --onefile --windowed --name ${{ env.WINDOWS_PACKAGE }} ./src/__init__.py
- name: Upload Installer
id: upload-release-asset-windows
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./dist/${{ env.WINDOWS_PACKAGE }}
asset_name: ${{ env.WINDOWS_PACKAGE }}
asset_content_type: application/octet-stream
build_linux_rpm:
name: Build (Linux RPM)
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]
runs-on: ${{ matrix.os }}
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build Installer
run: |
pyinstaller --onefile --windowed --name ${{ env.LINUX_RPM_PACKAGE }} ./src/__init__.py
- name: Upload Installer
id: upload-release-asset-linux-rpm
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./dist/${{ env.LINUX_RPM_PACKAGE }}
asset_name: ${{ env.LINUX_RPM_PACKAGE }}
asset_content_type: application/octet-stream
build_linux_deb:
name: Build (Linux Debian)
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]
runs-on: ${{ matrix.os }}
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build Installer
run: |
pyinstaller --onefile --windowed --name ${{ env.LINUX_DEB_PACKAGE }} ./src/__init__.py
- name: Upload Installer
id: upload-release-asset-linux-deb
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./dist/${{ env.LINUX_DEB_PACKAGE }}
asset_name: ${{ env.LINUX_DEB_PACKAGE }}
asset_content_type: application/octet-stream
build_macos:
name: Build (MacOS)
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
os: [ macos-latest ]
python-version: [ '3.10' ]
runs-on: ${{ matrix.os }}
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build Installer
run: |
pyinstaller --onefile --windowed --name ${{ env.MACOS_PACKAGE }} ./src/__init__.py
- name: Upload Installer
id: upload-release-asset-macos
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./dist/${{ env.MACOS_PACKAGE }}
asset_name: ${{ env.MACOS_PACKAGE }}
asset_content_type: application/octet-stream
publish:
name: Publish
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.10' ]
runs-on: ${{ matrix.os }}
permissions: write-all
needs: [ build_windows, build_linux_rpm, build_linux_deb, build_macos ]
steps:
- name: Publish Release
run: |
curl -X PATCH \
-H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"draft": false}' \
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"
# release_windows:
# name: Release for Windows
# permissions: write-all
# runs-on: windows-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install pyinstaller
#
# - name: Build Installer
# run: |
# pyinstaller --onefile --windowed --name M3U8Downloader-${{ github.event.release.tag_name }}-Windows.exe ./src/__init__.py
#
# - name: Upload Installer
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./dist/M3U8Downloader-${{ github.event.release.tag_name }}-Windows.exe
# asset_name: M3U8Downloader-${{ github.event.release.tag_name }}-Windows.exe
# asset_content_type: application/octet-stream
#
# - name: Publish Release
# if: ${{ steps.upload-release-asset.outcome == 'success' }}
# run: |
# $json = @{
# draft = $false
# } | ConvertTo-Json
# $header = @{
# Authorization = "Bearer ${{ secrets.GITHUB_TOKEN }}"
# Accept = "application/vnd.github.v3+json"
# }
# Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}" -Method Patch -ContentType "application/json" -Headers $header -Body $json
#
# release_ubuntu:
# name: Release for Ubuntu
# permissions: write-all
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install pyinstaller
#
# - name: Build Installer
# run: |
# pyinstaller --onefile --windowed --name M3U8Downloader-${{ github.event.release.tag_name }}-debian.deb ./src/__init__.py
#
# - name: Upload Installer
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./dist/M3U8Downloader-${{ github.event.release.tag_name }}-debian.deb
# asset_name: M3U8Downloader-${{ github.event.release.tag_name }}-debian.deb
# asset_content_type: application/octet-stream
#
# - name: Publish Release
# if: ${{ steps.upload-release-asset.outcome == 'success' }}
# run: |
# curl -X PATCH \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# -d '{"draft": false}' \
# "https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"
#
# release_rhel:
# name: Release for Linux
# permissions: write-all
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install pyinstaller
#
# - name: Build Installer
# run: |
# pyinstaller --onefile --windowed --name M3U8Downloader-${{ github.event.release.tag_name }}-linux.rpm ./src/__init__.py
#
# - name: Upload Installer
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./dist/M3U8Downloader-${{ github.event.release.tag_name }}-linux.rpm
# asset_name: M3U8Downloader-${{ github.event.release.tag_name }}-linux.rpm
# asset_content_type: application/octet-stream
#
# - name: Publish Release
# if: ${{ steps.upload-release-asset.outcome == 'success' }}
# run: |
# curl -X PATCH \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# -d '{"draft": false}' \
# "https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"