-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (48 loc) · 1.57 KB
/
release.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
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