Skip to content

Release

Release #10

Workflow file for this run

name: Release
on:
release:
types: [published]
branches:
- '*'
jobs:
release:
permissions: write-all
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
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.exe ./src/__init__.py
cd dist
ls
- 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.exe
asset_name: M3U8Downloader.exe
asset_content_type: application/octet-stream
- name: Publish Release
if: ${{ steps.upload-release-asset.outcome == 'success' }}
run: |
$token = ${{ secrets.GITHUB_TOKEN }}
$json = @{
draft = $false
} | ConvertTo-Json
$header = @{
Authorization = "Bearer $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