-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4f1098
commit 4744819
Showing
1 changed file
with
19 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,6 @@ on: | |
type: boolean | ||
default: false | ||
required: false | ||
buildOnly: | ||
description: 'Only build GUI' | ||
type: boolean | ||
default: true | ||
required: false | ||
|
||
jobs: | ||
build: | ||
|
@@ -66,18 +61,13 @@ jobs: | |
(Get-Content $filePath) | Foreach-Object {$_ -replace '\$ffmpeg-version\$', "$version"} | Set-Content $filePath | ||
(Get-Content $filePath) | Foreach-Object {$_ -replace '\$ffmpeg-version-url\$', "$website"} | Set-Content $filePath | ||
- name: Download FFmpeg | ||
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.inputs.buildOnly == 'false' }} || ${{ github.event.inputs.doRelease == 'true' }} | ||
run: | | ||
mkdir temp > $null | ||
# Download ffmpeg | ||
mkdir temp > $null | ||
$browser_download_url = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" | ||
Write-Host FFmpeg-Download-Url: $browser_download_url | ||
Invoke-WebRequest -Uri $browser_download_url -OutFile temp/ffmpeg-master-latest-win64-gpl.zip | ||
Expand-Archive -Path temp/ffmpeg-master-latest-win64-gpl.zip -DestinationPath ./temp | ||
mv temp/ffmpeg-master-latest-win64-gpl/bin/ffmpeg.exe dist/ffmpeg.exe | ||
Remove-Item -Recurse -Force ./temp | ||
- name: Update BBDown version | ||
|
@@ -95,12 +85,8 @@ jobs: | |
(Get-Content $filePath) | Foreach-Object {$_ -replace '\$bbdown-version\$', "$version"} | Set-Content $filePath | ||
(Get-Content $filePath) | Foreach-Object {$_ -replace '\$bbdown-version-url\$', "$website"} | Set-Content $filePath | ||
- name: Download BBDown | ||
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.inputs.buildOnly == 'false' }} || ${{ github.event.inputs.doRelease == 'true' }} | ||
run: | | ||
mkdir temp > $null | ||
# Download BBDown | ||
mkdir temp > $null | ||
$url = "https://api.github.com/repos/nilaoda/BBDown/releases/latest" | ||
$response = Invoke-WebRequest -Uri $url | ConvertFrom-Json | ||
$asset = $response.assets | Where-Object { $_.name -like "*win-x64*" } | ||
|
@@ -109,7 +95,6 @@ jobs: | |
Invoke-WebRequest -Uri $browser_download_url -OutFile temp/BBDown_win-x64.zip | ||
Expand-Archive -Path temp/BBDown_win-x64.zip -DestinationPath ./temp | ||
mv temp/BBDown.exe dist/BBDown.exe | ||
Remove-Item -Recurse -Force ./temp | ||
- name: Update aria2 version | ||
|
@@ -127,12 +112,8 @@ jobs: | |
(Get-Content $filePath) | Foreach-Object {$_ -replace '\$aria2c-version\$', "$version"} | Set-Content $filePath | ||
(Get-Content $filePath) | Foreach-Object {$_ -replace '\$aria2c-version-url\$', "$website"} | Set-Content $filePath | ||
- name: Download aria2 | ||
if: ${{ github.ref == 'refs/heads/main' }} || ${{ github.event.inputs.buildOnly == 'false' }} || ${{ github.event.inputs.doRelease == 'true' }} | ||
run: | | ||
mkdir temp > $null | ||
# Download aria2 | ||
mkdir temp > $null | ||
$url = "https://api.github.com/repos/aria2/aria2/releases/latest" | ||
$response = Invoke-WebRequest -Uri $url | ConvertFrom-Json | ||
$asset = $response.assets | Where-Object { $_.name -like "*win-64bit*" } | ||
|
@@ -150,28 +131,36 @@ jobs: | |
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pyinstaller | ||
- name: build py to exe | ||
run: | | ||
pyinstaller --noconfirm --onefile --noconsole --icon "./BBDown_GUI/UI/favicon.ico" --add-data "./BBDown_GUI/UI/favicon.ico;./UI" "./build-to-exe.py" | ||
- name: Rename build file | ||
run: | | ||
cd dist | ||
mv build-to-exe.exe BBDown_GUI.exe | ||
- name: Upload a Build Artifact | ||
mv ./dist/build-to-exe.exe ./dist/BBDown_GUI.exe | ||
- name: Upload a Build Artifact (Full) | ||
uses: actions/[email protected] | ||
with: | ||
name: BBDown_GUI | ||
path: dist | ||
- name: Upload a Build Artifact (Single File) | ||
uses: actions/[email protected] | ||
with: | ||
name: BBDown_GUI_single_file | ||
path: dist | ||
|
||
|
||
- name: Compress the Full | ||
if: ${{ github.event.inputs.doRelease == 'true' }} | ||
run: | | ||
Compress-Archive -Path dist/* -DestinationPath ./BBDown_GUI_Full.zip | ||
- name: GH Release | ||
if: ${{ github.event.inputs.doRelease == 'true' }} | ||
uses: softprops/[email protected] | ||
with: | ||
files: | | ||
dist/BBDown_GUI.exe | ||
dist | ||
LICENSE | ||
BBDown_GUI_Full.zip | ||
draft: true | ||
generate_release_notes: true | ||
|